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/web_contents/web_contents_view_aura.h" | 5 #include "content/browser/web_contents/web_contents_view_aura.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1464 for (size_t i = 0; i < window_->children().size(); i++) { | 1464 for (size_t i = 0; i < window_->children().size(); i++) { |
1465 if (window_->children()[i]->GetProperty( | 1465 if (window_->children()[i]->GetProperty( |
1466 aura::client::kConstrainedWindowKey)) { | 1466 aura::client::kConstrainedWindowKey)) { |
1467 gfx::Rect bounds = window_->children()[i]->bounds(); | 1467 gfx::Rect bounds = window_->children()[i]->bounds(); |
1468 bounds.set_origin( | 1468 bounds.set_origin( |
1469 gfx::Point((new_bounds.width() - bounds.width()) / 2, | 1469 gfx::Point((new_bounds.width() - bounds.width()) / 2, |
1470 (new_bounds.height() - bounds.height()) / 2)); | 1470 (new_bounds.height() - bounds.height()) / 2)); |
1471 window_->children()[i]->SetBounds(bounds); | 1471 window_->children()[i]->SetBounds(bounds); |
1472 } | 1472 } |
1473 } | 1473 } |
| 1474 |
| 1475 #if defined(OS_WIN) |
| 1476 if (!legacy_hwnd_ && window_ && window_->GetHost()) { |
| 1477 HWND parent_hwnd = window_->GetHost()->GetAcceleratedWidget(); |
| 1478 CHECK(parent_hwnd); |
| 1479 legacy_hwnd_.reset(LegacyRenderWidgetHostHWND::Create(parent_hwnd, this)); |
| 1480 } |
| 1481 |
| 1482 if (legacy_hwnd_) |
| 1483 legacy_hwnd_->SetBounds(window_->GetBoundsInRootWindow()); |
| 1484 #endif |
1474 } | 1485 } |
1475 | 1486 |
1476 gfx::NativeCursor WebContentsViewAura::GetCursor(const gfx::Point& point) { | 1487 gfx::NativeCursor WebContentsViewAura::GetCursor(const gfx::Point& point) { |
1477 return gfx::kNullCursor; | 1488 return gfx::kNullCursor; |
1478 } | 1489 } |
1479 | 1490 |
1480 int WebContentsViewAura::GetNonClientComponent(const gfx::Point& point) const { | 1491 int WebContentsViewAura::GetNonClientComponent(const gfx::Point& point) const { |
1481 return HTCLIENT; | 1492 return HTCLIENT; |
1482 } | 1493 } |
1483 | 1494 |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1700 BrowserAccessibilityManager* manager = | 1711 BrowserAccessibilityManager* manager = |
1701 web_contents_->GetRootBrowserAccessibilityManager(); | 1712 web_contents_->GetRootBrowserAccessibilityManager(); |
1702 if (!manager) | 1713 if (!manager) |
1703 return nullptr; | 1714 return nullptr; |
1704 | 1715 |
1705 return manager->GetRoot()->ToBrowserAccessibilityWin(); | 1716 return manager->GetRoot()->ToBrowserAccessibilityWin(); |
1706 } | 1717 } |
1707 #endif | 1718 #endif |
1708 | 1719 |
1709 } // namespace content | 1720 } // namespace content |
OLD | NEW |