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

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

Issue 771353004: Make sure Legacy HWND is created and has proper bounds on bounds change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@legacy_fix_ondestroy
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 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after
1471 for (size_t i = 0; i < window_->children().size(); i++) { 1471 for (size_t i = 0; i < window_->children().size(); i++) {
1472 if (window_->children()[i]->GetProperty( 1472 if (window_->children()[i]->GetProperty(
1473 aura::client::kConstrainedWindowKey)) { 1473 aura::client::kConstrainedWindowKey)) {
1474 gfx::Rect bounds = window_->children()[i]->bounds(); 1474 gfx::Rect bounds = window_->children()[i]->bounds();
1475 bounds.set_origin( 1475 bounds.set_origin(
1476 gfx::Point((new_bounds.width() - bounds.width()) / 2, 1476 gfx::Point((new_bounds.width() - bounds.width()) / 2,
1477 (new_bounds.height() - bounds.height()) / 2)); 1477 (new_bounds.height() - bounds.height()) / 2));
1478 window_->children()[i]->SetBounds(bounds); 1478 window_->children()[i]->SetBounds(bounds);
1479 } 1479 }
1480 } 1480 }
1481
1482 #if defined(OS_WIN)
1483 if (!legacy_hwnd_ && window_ && window_->GetHost()) {
1484 HWND parent_hwnd = window_->GetHost()->GetAcceleratedWidget();
1485 CHECK(parent_hwnd);
ananta 2014/12/05 19:58:02 Please verify if this does not crash in Windows 8
dmazzoni 2014/12/05 20:56:06 Verified manually. This same CHECK appears above t
1486 legacy_hwnd_.reset(LegacyRenderWidgetHostHWND::Create(parent_hwnd, this));
1487 }
1488
1489 if (legacy_hwnd_)
1490 legacy_hwnd_->SetBounds(window_->GetBoundsInRootWindow());
1491 #endif
1481 } 1492 }
1482 1493
1483 gfx::NativeCursor WebContentsViewAura::GetCursor(const gfx::Point& point) { 1494 gfx::NativeCursor WebContentsViewAura::GetCursor(const gfx::Point& point) {
1484 return gfx::kNullCursor; 1495 return gfx::kNullCursor;
1485 } 1496 }
1486 1497
1487 int WebContentsViewAura::GetNonClientComponent(const gfx::Point& point) const { 1498 int WebContentsViewAura::GetNonClientComponent(const gfx::Point& point) const {
1488 return HTCLIENT; 1499 return HTCLIENT;
1489 } 1500 }
1490 1501
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
1714 BrowserAccessibilityManager* manager = 1725 BrowserAccessibilityManager* manager =
1715 web_contents_->GetRootBrowserAccessibilityManager(); 1726 web_contents_->GetRootBrowserAccessibilityManager();
1716 if (!manager) 1727 if (!manager)
1717 return nullptr; 1728 return nullptr;
1718 1729
1719 return manager->GetRoot()->ToBrowserAccessibilityWin(); 1730 return manager->GetRoot()->ToBrowserAccessibilityWin();
1720 } 1731 }
1721 #endif 1732 #endif
1722 1733
1723 } // namespace content 1734 } // 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