| 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 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1355 gfx::Rect(current_frame_size_), | 1355 gfx::Rect(current_frame_size_), |
| 1356 frame, | 1356 frame, |
| 1357 base::Bind(callback, present_time)); | 1357 base::Bind(callback, present_time)); |
| 1358 } | 1358 } |
| 1359 } | 1359 } |
| 1360 } | 1360 } |
| 1361 | 1361 |
| 1362 #if defined(OS_WIN) | 1362 #if defined(OS_WIN) |
| 1363 void RenderWidgetHostViewAura::UpdateConstrainedWindowRects( | 1363 void RenderWidgetHostViewAura::UpdateConstrainedWindowRects( |
| 1364 const std::vector<gfx::Rect>& rects) { | 1364 const std::vector<gfx::Rect>& rects) { |
| 1365 // Check this before setting constrained_rects_, so that next time they're set |
| 1366 // and we have a root window we don't early return. |
| 1367 if (!window_->GetDispatcher()) |
| 1368 return; |
| 1369 |
| 1365 if (rects == constrained_rects_) | 1370 if (rects == constrained_rects_) |
| 1366 return; | 1371 return; |
| 1372 |
| 1367 constrained_rects_ = rects; | 1373 constrained_rects_ = rects; |
| 1368 UpdateCutoutRects(); | |
| 1369 } | |
| 1370 | 1374 |
| 1371 void RenderWidgetHostViewAura::UpdateCutoutRects() { | |
| 1372 if (!window_->GetRootWindow()) | |
| 1373 return; | |
| 1374 HWND parent = window_->GetDispatcher()->host()->GetAcceleratedWidget(); | 1375 HWND parent = window_->GetDispatcher()->host()->GetAcceleratedWidget(); |
| 1375 CutoutRectsParams params; | 1376 CutoutRectsParams params; |
| 1376 params.widget = this; | 1377 params.widget = this; |
| 1377 params.cutout_rects = constrained_rects_; | 1378 params.cutout_rects = constrained_rects_; |
| 1378 params.geometry = &plugin_window_moves_; | 1379 params.geometry = &plugin_window_moves_; |
| 1379 LPARAM lparam = reinterpret_cast<LPARAM>(¶ms); | 1380 LPARAM lparam = reinterpret_cast<LPARAM>(¶ms); |
| 1380 EnumChildWindows(parent, SetCutoutRectsCallback, lparam); | 1381 EnumChildWindows(parent, SetCutoutRectsCallback, lparam); |
| 1381 } | 1382 } |
| 1382 #endif | 1383 #endif |
| 1383 | 1384 |
| (...skipping 2178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3562 RenderWidgetHost* widget) { | 3563 RenderWidgetHost* widget) { |
| 3563 return new RenderWidgetHostViewAura(widget); | 3564 return new RenderWidgetHostViewAura(widget); |
| 3564 } | 3565 } |
| 3565 | 3566 |
| 3566 // static | 3567 // static |
| 3567 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 3568 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
| 3568 GetScreenInfoForWindow(results, NULL); | 3569 GetScreenInfoForWindow(results, NULL); |
| 3569 } | 3570 } |
| 3570 | 3571 |
| 3571 } // namespace content | 3572 } // namespace content |
| OLD | NEW |