Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Side by Side Diff: content/browser/web_contents/web_contents_view_aura.cc

Issue 796243002: Merge to M40: Make sure Legacy HWND is created and has proper bounds on bounds change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2214
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698