OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1330 gfx::Rect(current_frame_size_), | 1330 gfx::Rect(current_frame_size_), |
1331 frame, | 1331 frame, |
1332 base::Bind(callback, present_time)); | 1332 base::Bind(callback, present_time)); |
1333 } | 1333 } |
1334 } | 1334 } |
1335 } | 1335 } |
1336 | 1336 |
1337 #if defined(OS_WIN) | 1337 #if defined(OS_WIN) |
1338 void RenderWidgetHostViewAura::UpdateConstrainedWindowRects( | 1338 void RenderWidgetHostViewAura::UpdateConstrainedWindowRects( |
1339 const std::vector<gfx::Rect>& rects) { | 1339 const std::vector<gfx::Rect>& rects) { |
| 1340 // Check this before setting constrained_rects_, so that next time they're set |
| 1341 // and we have a root window we don't early return. |
| 1342 if (!window_->GetDispatcher()) |
| 1343 return; |
| 1344 |
1340 if (rects == constrained_rects_) | 1345 if (rects == constrained_rects_) |
1341 return; | 1346 return; |
| 1347 |
1342 constrained_rects_ = rects; | 1348 constrained_rects_ = rects; |
1343 UpdateCutoutRects(); | |
1344 } | |
1345 | 1349 |
1346 void RenderWidgetHostViewAura::UpdateCutoutRects() { | |
1347 if (!window_->GetRootWindow()) | |
1348 return; | |
1349 HWND parent = window_->GetDispatcher()->host()->GetAcceleratedWidget(); | 1350 HWND parent = window_->GetDispatcher()->host()->GetAcceleratedWidget(); |
1350 CutoutRectsParams params; | 1351 CutoutRectsParams params; |
1351 params.widget = this; | 1352 params.widget = this; |
1352 params.cutout_rects = constrained_rects_; | 1353 params.cutout_rects = constrained_rects_; |
1353 params.geometry = &plugin_window_moves_; | 1354 params.geometry = &plugin_window_moves_; |
1354 LPARAM lparam = reinterpret_cast<LPARAM>(¶ms); | 1355 LPARAM lparam = reinterpret_cast<LPARAM>(¶ms); |
1355 EnumChildWindows(parent, SetCutoutRectsCallback, lparam); | 1356 EnumChildWindows(parent, SetCutoutRectsCallback, lparam); |
1356 } | 1357 } |
1357 #endif | 1358 #endif |
1358 | 1359 |
(...skipping 2133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3492 RenderWidgetHost* widget) { | 3493 RenderWidgetHost* widget) { |
3493 return new RenderWidgetHostViewAura(widget); | 3494 return new RenderWidgetHostViewAura(widget); |
3494 } | 3495 } |
3495 | 3496 |
3496 // static | 3497 // static |
3497 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 3498 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
3498 GetScreenInfoForWindow(results, NULL); | 3499 GetScreenInfoForWindow(results, NULL); |
3499 } | 3500 } |
3500 | 3501 |
3501 } // namespace content | 3502 } // namespace content |
OLD | NEW |