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_window_tree_host.h" | 8 #include "chrome/browser/ui/views/frame/browser_desktop_window_tree_host.h" |
9 #include "chrome/browser/ui/views/frame/browser_shutdown.h" | |
10 #include "chrome/browser/ui/views/frame/browser_view.h" | 9 #include "chrome/browser/ui/views/frame/browser_view.h" |
11 #include "chrome/browser/web_applications/web_app.h" | 10 #include "chrome/browser/web_applications/web_app.h" |
12 #include "ui/aura/client/aura_constants.h" | 11 #include "ui/aura/client/aura_constants.h" |
13 #include "ui/aura/window.h" | 12 #include "ui/aura/window.h" |
14 #include "ui/aura/window_event_dispatcher.h" | 13 #include "ui/aura/window_event_dispatcher.h" |
15 #include "ui/aura/window_observer.h" | 14 #include "ui/aura/window_observer.h" |
16 #include "ui/base/hit_test.h" | 15 #include "ui/base/hit_test.h" |
17 #include "ui/base/models/simple_menu_model.h" | 16 #include "ui/base/models/simple_menu_model.h" |
18 #include "ui/gfx/font.h" | 17 #include "ui/gfx/font.h" |
19 #include "ui/views/view.h" | 18 #include "ui/views/view.h" |
(...skipping 18 matching lines...) Expand all Loading... |
38 /////////////////////////////////////////////////////////////////////////////// | 37 /////////////////////////////////////////////////////////////////////////////// |
39 // DesktopBrowserFrameAura, protected: | 38 // DesktopBrowserFrameAura, protected: |
40 | 39 |
41 DesktopBrowserFrameAura::~DesktopBrowserFrameAura() { | 40 DesktopBrowserFrameAura::~DesktopBrowserFrameAura() { |
42 } | 41 } |
43 | 42 |
44 /////////////////////////////////////////////////////////////////////////////// | 43 /////////////////////////////////////////////////////////////////////////////// |
45 // DesktopBrowserFrameAura, views::DesktopNativeWidgetAura overrides: | 44 // DesktopBrowserFrameAura, views::DesktopNativeWidgetAura overrides: |
46 | 45 |
47 void DesktopBrowserFrameAura::OnHostClosed() { | 46 void DesktopBrowserFrameAura::OnHostClosed() { |
48 // Destroy any remaining WebContents early on. Doing so may result in | |
49 // calling back to one of the Views/LayoutManagers or supporting classes of | |
50 // BrowserView. By destroying here we ensure all said classes are valid. | |
51 DestroyBrowserWebContents(browser_view_->browser()); | |
52 aura::client::SetVisibilityClient(GetNativeView()->GetRootWindow(), nullptr); | 47 aura::client::SetVisibilityClient(GetNativeView()->GetRootWindow(), nullptr); |
53 DesktopNativeWidgetAura::OnHostClosed(); | 48 DesktopNativeWidgetAura::OnHostClosed(); |
54 } | 49 } |
55 | 50 |
56 void DesktopBrowserFrameAura::InitNativeWidget( | 51 void DesktopBrowserFrameAura::InitNativeWidget( |
57 const views::Widget::InitParams& params) { | 52 const views::Widget::InitParams& params) { |
58 browser_desktop_window_tree_host_ = | 53 browser_desktop_window_tree_host_ = |
59 BrowserDesktopWindowTreeHost::CreateBrowserDesktopWindowTreeHost( | 54 BrowserDesktopWindowTreeHost::CreateBrowserDesktopWindowTreeHost( |
60 browser_frame_, | 55 browser_frame_, |
61 this, | 56 this, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 gfx::Rect* bounds, | 98 gfx::Rect* bounds, |
104 ui::WindowShowState* show_state) const { | 99 ui::WindowShowState* show_state) const { |
105 *bounds = GetWidget()->GetRestoredBounds(); | 100 *bounds = GetWidget()->GetRestoredBounds(); |
106 if (IsMaximized()) | 101 if (IsMaximized()) |
107 *show_state = ui::SHOW_STATE_MAXIMIZED; | 102 *show_state = ui::SHOW_STATE_MAXIMIZED; |
108 else if (IsMinimized()) | 103 else if (IsMinimized()) |
109 *show_state = ui::SHOW_STATE_MINIMIZED; | 104 *show_state = ui::SHOW_STATE_MINIMIZED; |
110 else | 105 else |
111 *show_state = ui::SHOW_STATE_NORMAL; | 106 *show_state = ui::SHOW_STATE_NORMAL; |
112 } | 107 } |
OLD | NEW |