OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/browser_frame_ash.h" | 5 #include "chrome/browser/ui/views/frame/browser_frame_ash.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/wm/window_properties.h" | 8 #include "ash/wm/window_properties.h" |
9 #include "ash/wm/window_state.h" | 9 #include "ash/wm/window_state.h" |
10 #include "ash/wm/window_state_delegate.h" | 10 #include "ash/wm/window_state_delegate.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 const char BrowserFrameAsh::kWindowName[] = "BrowserFrameAsh"; | 56 const char BrowserFrameAsh::kWindowName[] = "BrowserFrameAsh"; |
57 | 57 |
58 BrowserFrameAsh::BrowserFrameAsh(BrowserFrame* browser_frame, | 58 BrowserFrameAsh::BrowserFrameAsh(BrowserFrame* browser_frame, |
59 BrowserView* browser_view) | 59 BrowserView* browser_view) |
60 : views::NativeWidgetAura(browser_frame), | 60 : views::NativeWidgetAura(browser_frame), |
61 browser_view_(browser_view) { | 61 browser_view_(browser_view) { |
62 GetNativeWindow()->SetName(kWindowName); | 62 GetNativeWindow()->SetName(kWindowName); |
63 Browser* browser = browser_view->browser(); | 63 Browser* browser = browser_view->browser(); |
64 ash::wm::WindowState* window_state = | 64 ash::wm::WindowState* window_state = |
65 ash::wm::GetWindowState(GetNativeWindow()); | 65 ash::wm::GetWindowState(GetNativeWindow()); |
66 window_state->SetDelegate(scoped_ptr<ash::wm::WindowStateDelegate>( | 66 window_state->SetDelegate(std::unique_ptr<ash::wm::WindowStateDelegate>( |
67 new BrowserWindowStateDelegate(browser))); | 67 new BrowserWindowStateDelegate(browser))); |
68 | 68 |
69 // Turn on auto window management if we don't need an explicit bounds. | 69 // Turn on auto window management if we don't need an explicit bounds. |
70 // This way the requested bounds are honored. | 70 // This way the requested bounds are honored. |
71 if (!browser->bounds_overridden() && !browser->is_session_restore()) | 71 if (!browser->bounds_overridden() && !browser->is_session_restore()) |
72 SetWindowAutoManaged(); | 72 SetWindowAutoManaged(); |
73 #if defined(OS_CHROMEOS) | 73 #if defined(OS_CHROMEOS) |
74 // For legacy reasons v1 apps (like Secure Shell) are allowed to consume keys | 74 // For legacy reasons v1 apps (like Secure Shell) are allowed to consume keys |
75 // like brightness, volume, etc. Otherwise these keys are handled by the | 75 // like brightness, volume, etc. Otherwise these keys are handled by the |
76 // Ash window manager. | 76 // Ash window manager. |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 /////////////////////////////////////////////////////////////////////////////// | 172 /////////////////////////////////////////////////////////////////////////////// |
173 // BrowserFrameAsh, private: | 173 // BrowserFrameAsh, private: |
174 | 174 |
175 void BrowserFrameAsh::SetWindowAutoManaged() { | 175 void BrowserFrameAsh::SetWindowAutoManaged() { |
176 if (!browser_view_->browser()->is_type_popup() || | 176 if (!browser_view_->browser()->is_type_popup() || |
177 browser_view_->browser()->is_app()) { | 177 browser_view_->browser()->is_app()) { |
178 ash::wm::GetWindowState(GetNativeWindow())-> | 178 ash::wm::GetWindowState(GetNativeWindow())-> |
179 set_window_position_managed(true); | 179 set_window_position_managed(true); |
180 } | 180 } |
181 } | 181 } |
OLD | NEW |