diff --git print_handler_gtk.cc print_handler_gtk.cc
index 9a822b7a..3bfc30c5 100644
--- print_handler_gtk.cc
+++ print_handler_gtk.cc
@@ -1,22 +1,25 @@
+// COPIED from upstream "cef/tests/cefclient/browser/" directory
+// with minor modifications. See the .patch file in current directory.
+
// Copyright (c) 2014 The Chromium Embedded Framework Authors.
// Portions Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "tests/cefclient/browser/print_handler_gtk.h"
+#include "print_handler_gtk.h"
#include
#include
#include
+#include "include/base/cef_bind.h"
#include "include/base/cef_logging.h"
#include "include/base/cef_macros.h"
#include "include/wrapper/cef_helpers.h"
+#include "include/wrapper/cef_closure_task.h"
-#include "tests/cefclient/browser/root_window.h"
-
-namespace client {
+#include "client_handler/x11.h"
namespace {
@@ -373,7 +376,7 @@ struct ClientPrintHandlerGtk::PrintHandler {
CefRefPtr callback) {
dialog_callback_ = callback;
- GtkWindow* parent = GetWindow();
+ GtkWindow* parent = CefBrowser_GetGtkWindow(browser_);
// TODO(estade): We need a window title here.
dialog_ = gtk_print_unix_dialog_new(NULL, parent);
g_signal_connect(dialog_, "delete-event",
@@ -428,16 +431,6 @@ struct ClientPrintHandlerGtk::PrintHandler {
}
private:
- // Returns the GtkWindow* for the browser. Will return NULL when using the
- // Views framework.
- GtkWindow* GetWindow() {
- scoped_refptr root_window =
- RootWindow::GetForBrowser(browser_->GetIdentifier());
- if (root_window)
- return GTK_WINDOW(root_window->GetWindowHandle());
- return NULL;
- }
-
void OnDialogResponse(GtkDialog* dialog, gint response_id) {
int num_matched_handlers = g_signal_handlers_disconnect_by_func(
dialog_, reinterpret_cast(&OnDialogResponseThunk), this);
@@ -626,5 +619,3 @@ ClientPrintHandlerGtk::PrintHandler* ClientPrintHandlerGtk::GetPrintHandler(
DCHECK(it != print_handler_map_.end());
return it->second;
}
-
-} // namespace client
diff --git print_handler_gtk.h print_handler_gtk.h
index 857b8c72..f7878416 100644
--- print_handler_gtk.h
+++ print_handler_gtk.h
@@ -1,3 +1,6 @@
+// COPIED from upstream "cef/tests/cefclient/browser/" directory
+// with minor modifications. See the .patch file in current directory.
+
// Copyright (c) 2014 The Chromium Embedded Framework Authors.
// Portions Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -11,8 +14,6 @@
#include "include/cef_print_handler.h"
-namespace client {
-
class ClientPrintHandlerGtk : public CefPrintHandler {
public:
ClientPrintHandlerGtk();
@@ -46,6 +47,4 @@ class ClientPrintHandlerGtk : public CefPrintHandler {
DISALLOW_COPY_AND_ASSIGN(ClientPrintHandlerGtk);
};
-} // namespace client
-
#endif // CEF_TESTS_CEFCLIENT_BROWSER_PRINT_HANDLER_GTK_H_