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 "chrome/browser/ui/views/frame/desktop_browser_frame_aura.h" | 5 #include "chrome/browser/ui/views/frame/desktop_browser_frame_aura.h" |
6 | 6 |
7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
8 #include "chrome/browser/ui/views/frame/browser_desktop_root_window_host.h" | 8 #include "chrome/browser/ui/views/frame/browser_desktop_root_window_host.h" |
| 9 #include "chrome/browser/ui/views/frame/browser_shutdown.h" |
9 #include "chrome/browser/ui/views/frame/browser_view.h" | 10 #include "chrome/browser/ui/views/frame/browser_view.h" |
10 #include "chrome/browser/ui/views/frame/desktop_user_action_handler_aura.h" | 11 #include "chrome/browser/ui/views/frame/desktop_user_action_handler_aura.h" |
11 #include "grit/chromium_strings.h" | 12 #include "grit/chromium_strings.h" |
12 #include "grit/generated_resources.h" | 13 #include "grit/generated_resources.h" |
13 #include "ui/aura/client/aura_constants.h" | 14 #include "ui/aura/client/aura_constants.h" |
14 #include "ui/aura/root_window.h" | 15 #include "ui/aura/root_window.h" |
15 #include "ui/aura/window.h" | 16 #include "ui/aura/window.h" |
16 #include "ui/aura/window_observer.h" | 17 #include "ui/aura/window_observer.h" |
17 #include "ui/base/hit_test.h" | 18 #include "ui/base/hit_test.h" |
18 #include "ui/base/l10n/l10n_util.h" | 19 #include "ui/base/l10n/l10n_util.h" |
(...skipping 20 matching lines...) Expand all Loading... |
39 /////////////////////////////////////////////////////////////////////////////// | 40 /////////////////////////////////////////////////////////////////////////////// |
40 // DesktopBrowserFrameAura, protected: | 41 // DesktopBrowserFrameAura, protected: |
41 | 42 |
42 DesktopBrowserFrameAura::~DesktopBrowserFrameAura() { | 43 DesktopBrowserFrameAura::~DesktopBrowserFrameAura() { |
43 } | 44 } |
44 | 45 |
45 /////////////////////////////////////////////////////////////////////////////// | 46 /////////////////////////////////////////////////////////////////////////////// |
46 // DesktopBrowserFrameAura, views::DesktopNativeWidgetAura overrides: | 47 // DesktopBrowserFrameAura, views::DesktopNativeWidgetAura overrides: |
47 | 48 |
48 void DesktopBrowserFrameAura::OnHostClosed() { | 49 void DesktopBrowserFrameAura::OnHostClosed() { |
| 50 // Destroy any remaining WebContents early on. Doing so may result in |
| 51 // calling back to one of the Views/LayoutManagers or supporting classes of |
| 52 // BrowserView. By destroying here we ensure all said classes are valid. |
| 53 DestroyBrowserWebContents(browser_view_->browser()); |
49 aura::client::SetVisibilityClient(GetNativeView()->GetRootWindow(), NULL); | 54 aura::client::SetVisibilityClient(GetNativeView()->GetRootWindow(), NULL); |
50 DesktopNativeWidgetAura::OnHostClosed(); | 55 DesktopNativeWidgetAura::OnHostClosed(); |
51 } | 56 } |
52 | 57 |
53 void DesktopBrowserFrameAura::InitNativeWidget( | 58 void DesktopBrowserFrameAura::InitNativeWidget( |
54 const views::Widget::InitParams& params) { | 59 const views::Widget::InitParams& params) { |
55 browser_desktop_root_window_host_ = | 60 browser_desktop_root_window_host_ = |
56 BrowserDesktopWindowTreeHost::CreateBrowserDesktopWindowTreeHost( | 61 BrowserDesktopWindowTreeHost::CreateBrowserDesktopWindowTreeHost( |
57 browser_frame_, | 62 browser_frame_, |
58 this, | 63 this, |
(...skipping 27 matching lines...) Expand all Loading... |
86 return this; | 91 return this; |
87 } | 92 } |
88 | 93 |
89 bool DesktopBrowserFrameAura::UsesNativeSystemMenu() const { | 94 bool DesktopBrowserFrameAura::UsesNativeSystemMenu() const { |
90 return browser_desktop_root_window_host_->UsesNativeSystemMenu(); | 95 return browser_desktop_root_window_host_->UsesNativeSystemMenu(); |
91 } | 96 } |
92 | 97 |
93 int DesktopBrowserFrameAura::GetMinimizeButtonOffset() const { | 98 int DesktopBrowserFrameAura::GetMinimizeButtonOffset() const { |
94 return browser_desktop_root_window_host_->GetMinimizeButtonOffset(); | 99 return browser_desktop_root_window_host_->GetMinimizeButtonOffset(); |
95 } | 100 } |
OLD | NEW |