~chromium-team/chromium-browser/artful-beta

« back to all changes in this revision

Viewing changes to debian/patches/coordinate-space-map

  • Committer: Chad MILLER
  • Date: 2015-04-17 00:17:26 UTC
  • Revision ID: chad.miller@canonical.com-20150417001726-dszj422xuq86ob42
* Upstream release 42.0.2311.90:
  - CVE-2015-1235: Cross-origin-bypass in HTML parser.
  - CVE-2015-1236: Cross-origin-bypass in Blink.
  - CVE-2015-1237: Use-after-free in IPC.
  - CVE-2015-1238: Out-of-bounds write in Skia.
  - CVE-2015-1240: Out-of-bounds read in WebGL.
  - CVE-2015-1241: Tap-Jacking.
  - CVE-2015-1242: Type confusion in V8.
  - CVE-2015-1244: HSTS bypass in WebSockets.
  - CVE-2015-1245: Use-after-free in PDFium.
  - CVE-2015-1247: Scheme issues in OpenSearch.
  - CVE-2015-1248: SafeBrowsing bypass.
* Upstream release 41.0.2272.118:
  - CVE-2015-1233: A special thanks to Anonymous for a combination of V8,
    Gamepad and IPC bugs that can lead to remote code execution outside of
    the sandbox. 
  - CVE-2015-1234: Buffer overflow via race condition in GPU.
* debian/chromium-browser-etc-customizations-flash-staleness: Ask sudo users
  to update flash player.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
--- a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
2
 
+++ b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
3
 
@@ -678,6 +678,8 @@ Gtk2UI::GetDefaultPangoFontDescription()
4
 
 }
5
 
 
6
 
 double Gtk2UI::GetFontDPI() const {
7
 
+  return 96.0;  // Scale in display layer, not here. Use internal assumtpion of ~100DPI here.
8
 
+
9
 
   GtkSettings* gtk_settings = gtk_settings_get_default();
10
 
   CHECK(gtk_settings);
11
 
   gint dpi = -1;
12
1
--- a/ui/gfx/display.cc
13
2
+++ b/ui/gfx/display.cc
14
3
@@ -140,7 +140,7 @@ void Display::SetScaleAndBounds(
51
40
 #include "ui/gfx/image/image_skia.h"
52
41
 #include "ui/gfx/image/image_skia_rep.h"
53
42
 #include "ui/gfx/path.h"
54
 
@@ -131,6 +132,46 @@ const char kX11WindowRoleBubble[] = "bub
 
43
@@ -132,6 +133,46 @@ const char kX11WindowRoleBubble[] = "bub
55
44
 
56
45
 }  // namespace
57
46
 
98
87
 ////////////////////////////////////////////////////////////////////////////////
99
88
 // DesktopWindowTreeHostX11, public:
100
89
 
101
 
@@ -384,7 +425,7 @@ void DesktopWindowTreeHostX11::ShowMaxim
 
90
@@ -385,7 +426,7 @@ void DesktopWindowTreeHostX11::ShowMaxim
102
91
     const gfx::Rect& restored_bounds) {
103
92
   ShowWindowWithState(ui::SHOW_STATE_MAXIMIZED);
104
93
   // Enforce |restored_bounds_| since calling Maximize() could have reset it.
107
96
 }
108
97
 
109
98
 bool DesktopWindowTreeHostX11::IsVisible() const {
110
 
@@ -392,7 +433,7 @@ bool DesktopWindowTreeHostX11::IsVisible
 
99
@@ -393,7 +434,7 @@ bool DesktopWindowTreeHostX11::IsVisible
111
100
 }
112
101
 
113
102
 void DesktopWindowTreeHostX11::SetSize(const gfx::Size& requested_size) {
116
105
   bool size_changed = bounds_.size() != size;
117
106
   XResizeWindow(xdisplay_, xwindow_, size.width(), size.height());
118
107
   bounds_.set_size(size);
119
 
@@ -406,7 +447,8 @@ void DesktopWindowTreeHostX11::StackAtTo
 
108
@@ -407,7 +448,8 @@ void DesktopWindowTreeHostX11::StackAtTo
120
109
   XRaiseWindow(xdisplay_, xwindow_);
121
110
 }
122
111
 
126
115
   gfx::Rect parent_bounds = GetWorkAreaBoundsInScreen();
127
116
 
128
117
   // If |window_|'s transient parent bounds are big enough to contain |size|,
129
 
@@ -451,7 +493,7 @@ void DesktopWindowTreeHostX11::GetWindow
 
118
@@ -452,7 +494,7 @@ void DesktopWindowTreeHostX11::GetWindow
130
119
 }
131
120
 
132
121
 gfx::Rect DesktopWindowTreeHostX11::GetWindowBoundsInScreen() const {
135
124
 }
136
125
 
137
126
 gfx::Rect DesktopWindowTreeHostX11::GetClientAreaBoundsInScreen() const {
138
 
@@ -463,7 +505,7 @@ gfx::Rect DesktopWindowTreeHostX11::GetC
 
127
@@ -464,7 +506,7 @@ gfx::Rect DesktopWindowTreeHostX11::GetC
139
128
   // Attempts to calculate the rect by asking the NonClientFrameView what it
140
129
   // thought its GetBoundsForClientView() were broke combobox drop down
141
130
   // placement.
144
133
 }
145
134
 
146
135
 gfx::Rect DesktopWindowTreeHostX11::GetRestoredBounds() const {
147
 
@@ -472,7 +514,7 @@ gfx::Rect DesktopWindowTreeHostX11::GetR
 
136
@@ -473,7 +515,7 @@ gfx::Rect DesktopWindowTreeHostX11::GetR
148
137
   // or restoring bounds, we can record the current bounds before we request
149
138
   // maximization, and clear it when we detect a state change.
150
139
   if (!restored_bounds_.IsEmpty())
153
142
 
154
143
   return GetWindowBoundsInScreen();
155
144
 }
156
 
@@ -481,7 +523,7 @@ gfx::Rect DesktopWindowTreeHostX11::GetW
 
145
@@ -482,7 +524,7 @@ gfx::Rect DesktopWindowTreeHostX11::GetW
157
146
   std::vector<int> value;
158
147
   if (ui::GetIntArrayProperty(x_root_window_, "_NET_WORKAREA", &value) &&
159
148
       value.size() >= 4) {
162
151
   }
163
152
 
164
153
   // Fetch the geometry of the root window.
165
 
@@ -492,10 +534,10 @@ gfx::Rect DesktopWindowTreeHostX11::GetW
 
154
@@ -493,10 +535,10 @@ gfx::Rect DesktopWindowTreeHostX11::GetW
166
155
   if (!XGetGeometry(xdisplay_, x_root_window_, &root, &x, &y,
167
156
                     &width, &height, &border_width, &depth)) {
168
157
     NOTIMPLEMENTED();
175
164
 }
176
165
 
177
166
 void DesktopWindowTreeHostX11::SetShape(gfx::NativeRegion native_region) {
178
 
@@ -1060,8 +1102,8 @@ void DesktopWindowTreeHostX11::InitX11Wi
 
167
@@ -1061,8 +1103,8 @@ void DesktopWindowTreeHostX11::InitX11Wi
179
168
     }
180
169
   }
181
170
 
186
175
   xwindow_ = XCreateWindow(
187
176
       xdisplay_, x_root_window_,
188
177
       bounds_.x(), bounds_.y(),
189
 
@@ -1449,7 +1491,7 @@ void DesktopWindowTreeHostX11::DispatchM
190
 
   } else {
191
 
     // Another DesktopWindowTreeHostX11 has installed itself as
192
 
     // capture. Translate the event's location and dispatch to the other.
193
 
-    event->ConvertLocationToTarget(window(), g_current_capture->window());
194
 
+    ConvertEventToDifferentHost(event, g_current_capture);
195
 
     g_current_capture->SendEventToProcessor(event);
196
 
   }
197
 
 }
198
 
@@ -1457,13 +1499,29 @@ void DesktopWindowTreeHostX11::DispatchM
199
 
 void DesktopWindowTreeHostX11::DispatchTouchEvent(ui::TouchEvent* event) {
200
 
   if (g_current_capture && g_current_capture != this &&
201
 
       event->type() == ui::ET_TOUCH_PRESSED) {
202
 
-    event->ConvertLocationToTarget(window(), g_current_capture->window());
203
 
+    ConvertEventToDifferentHost(event, g_current_capture);
204
 
     g_current_capture->SendEventToProcessor(event);
205
 
   } else {
206
 
     SendEventToProcessor(event);
207
 
   }
208
 
 }
209
 
 
210
 
+void DesktopWindowTreeHostX11::ConvertEventToDifferentHost(
211
 
+    ui::LocatedEvent* located_event,
212
 
+    DesktopWindowTreeHostX11* host) {
213
 
+  DCHECK_NE(this, host);
214
 
+  const gfx::Display display_src =
215
 
+      gfx::Screen::GetNativeScreen()->GetDisplayNearestWindow(window());
216
 
+  const gfx::Display display_dest =
217
 
+      gfx::Screen::GetNativeScreen()->GetDisplayNearestWindow(host->window());
218
 
+  DCHECK_EQ(display_src.device_scale_factor(),
219
 
+            display_dest.device_scale_factor());
220
 
+  gfx::Vector2d offset = GetLocationOnNativeScreen() -
221
 
+                         host->GetLocationOnNativeScreen();
222
 
+  gfx::Point location_in_pixel_in_host = located_event->location() + offset;
223
 
+  located_event->set_location(location_in_pixel_in_host);
224
 
+}
225
 
+
226
 
 void DesktopWindowTreeHostX11::ResetWindowRegion() {
227
 
   // If a custom window shape was supplied then apply it.
228
 
   if (custom_window_shape_) {
229
178
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
230
179
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
231
 
@@ -166,6 +166,7 @@ class VIEWS_EXPORT DesktopWindowTreeHost
232
 
   ui::EventProcessor* GetEventProcessor() override;
233
 
 
234
 
  private:
235
 
+  friend class DesktopWindowTreeHostX11HighDPITest;
236
 
   // Initializes our X11 surface to draw on. This method performs all
237
 
   // initialization related to talking to the X11 server.
238
 
   void InitX11Window(const Widget::InitParams& params);
239
 
@@ -211,6 +212,11 @@ class VIEWS_EXPORT DesktopWindowTreeHost
240
 
   // and dispatched to that host instead.
241
 
   void DispatchTouchEvent(ui::TouchEvent* event);
242
 
 
243
 
+  // Updates the location of |located_event| to be in |host|'s coordinate system
244
 
+  // so that it can be dispatched to |host|.
245
 
+  void ConvertEventToDifferentHost(ui::LocatedEvent* located_event,
246
 
+                                   DesktopWindowTreeHostX11* host);
247
 
+
248
 
   // Resets the window region for the current widget bounds if necessary.
249
 
   void ResetWindowRegion();
250
 
 
251
 
@@ -342,6 +348,13 @@ class VIEWS_EXPORT DesktopWindowTreeHost
 
180
@@ -348,6 +348,13 @@ class VIEWS_EXPORT DesktopWindowTreeHost
252
181
   DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11);
253
182
 };
254
183
 
264
193
 #endif  // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_
265
194
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc
266
195
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc
267
 
@@ -32,6 +32,8 @@ namespace views {
 
196
@@ -41,6 +41,8 @@ namespace {
268
197
 
269
 
 namespace {
 
198
 const int kPointerDeviceId = 1;
270
199
 
271
200
+const int kPointerDeviceId = 1;
272
201
+
273
202
 // Blocks till the window state hint, |hint|, is set or unset.
274
203
 class WMStateWaiter : public X11PropertyChangeWaiter {
275
204
  public:
276
 
@@ -454,4 +456,137 @@ TEST_F(DesktopWindowTreeHostX11Test, Tog
277
 
   EXPECT_TRUE(widget.GetNativeWindow()->IsVisible());
 
205
@@ -464,6 +466,139 @@ TEST_F(DesktopWindowTreeHostX11Test, Tog
278
206
 }
279
207
 
280
 
+class MouseEventRecorder : public ui::EventHandler {
 
208
 class MouseEventRecorder : public ui::EventHandler {
281
209
+ public:
282
210
+  MouseEventRecorder() {}
283
211
+  ~MouseEventRecorder() override {}
410
338
+  second.GetNativeWindow()->RemovePreTargetHandler(&second_recorder);
411
339
+}
412
340
+
413
 
 }  // namespace views
 
341
+class MouseEventRecorder : public ui::EventHandler {
 
342
  public:
 
343
   MouseEventRecorder() {}
 
344
   ~MouseEventRecorder() override {}
414
345
--- a/ui/views/widget/desktop_aura/x11_topmost_window_finder.cc
415
346
+++ b/ui/views/widget/desktop_aura/x11_topmost_window_finder.cc
416
347
@@ -21,7 +21,7 @@ X11TopmostWindowFinder::~X11TopmostWindo