forked from cztomczak/cefpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprint_handler_gtk.patch
More file actions
93 lines (81 loc) · 3.1 KB
/
print_handler_gtk.patch
File metadata and controls
93 lines (81 loc) · 3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
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 <vector>
#include <gtk/gtk.h>
#include <gtk/gtkunixprint.h>
+#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<CefPrintDialogCallback> 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<RootWindow> 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<gpointer>(&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_