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/wm/window_state.h" | 7 #include "ash/wm/window_state.h" |
8 #include "ash/wm/window_state_delegate.h" | 8 #include "ash/wm/window_state_delegate.h" |
9 #include "ash/wm/window_util.h" | 9 #include "ash/wm/window_util.h" |
10 #include "chrome/browser/ui/browser_commands.h" | 10 #include "chrome/browser/ui/browser_commands.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 // request (Shift+F4/F4) for browser (tabbed/popup) windows. | 23 // request (Shift+F4/F4) for browser (tabbed/popup) windows. |
24 class BrowserWindowStateDelegate : public ash::wm::WindowStateDelegate { | 24 class BrowserWindowStateDelegate : public ash::wm::WindowStateDelegate { |
25 public: | 25 public: |
26 explicit BrowserWindowStateDelegate(Browser* browser) | 26 explicit BrowserWindowStateDelegate(Browser* browser) |
27 : browser_(browser) { | 27 : browser_(browser) { |
28 DCHECK(browser_); | 28 DCHECK(browser_); |
29 } | 29 } |
30 virtual ~BrowserWindowStateDelegate(){} | 30 virtual ~BrowserWindowStateDelegate(){} |
31 | 31 |
32 // Overridden from ash::wm::WindowStateDelegate. | 32 // Overridden from ash::wm::WindowStateDelegate. |
33 virtual bool ToggleFullscreen(ash::wm::WindowState* window_state) OVERRIDE { | 33 virtual bool EnterImmersiveFullscreen( |
34 DCHECK(window_state->IsFullscreen() || window_state->CanMaximize()); | 34 ash::wm::WindowState* window_state) OVERRIDE { |
35 // Windows which cannot be maximized should not be fullscreened. | 35 // Immersive fullscreen is the same as browser fullscreen. |
36 if (!window_state->IsFullscreen() && !window_state->CanMaximize()) | 36 if (!window_state->IsFullscreen()) |
37 return true; | 37 chrome::ToggleFullscreenMode(browser_); |
38 chrome::ToggleFullscreenMode(browser_); | 38 return true; |
| 39 } |
| 40 virtual bool ExitFullscreen(ash::wm::WindowState* window_state) OVERRIDE { |
| 41 if (window_state->IsFullscreen()) |
| 42 chrome::ToggleFullscreenMode(browser_); |
39 return true; | 43 return true; |
40 } | 44 } |
41 private: | 45 private: |
42 Browser* browser_; // not owned. | 46 Browser* browser_; // not owned. |
43 | 47 |
44 DISALLOW_COPY_AND_ASSIGN(BrowserWindowStateDelegate); | 48 DISALLOW_COPY_AND_ASSIGN(BrowserWindowStateDelegate); |
45 }; | 49 }; |
46 | 50 |
47 // AppNonClientFrameViewAsh shows only the window controls and no | 51 // AppNonClientFrameViewAsh shows only the window controls and no |
48 // other window decorations which is pretty close to fullscreen. Put | 52 // other window decorations which is pretty close to fullscreen. Put |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 BrowserFrameAsh::~BrowserFrameAsh() { | 224 BrowserFrameAsh::~BrowserFrameAsh() { |
221 } | 225 } |
222 | 226 |
223 void BrowserFrameAsh::SetWindowAutoManaged() { | 227 void BrowserFrameAsh::SetWindowAutoManaged() { |
224 if (browser_view_->browser()->type() != Browser::TYPE_POPUP || | 228 if (browser_view_->browser()->type() != Browser::TYPE_POPUP || |
225 browser_view_->browser()->is_app()) { | 229 browser_view_->browser()->is_app()) { |
226 ash::wm::GetWindowState(GetNativeWindow())-> | 230 ash::wm::GetWindowState(GetNativeWindow())-> |
227 set_window_position_managed(true); | 231 set_window_position_managed(true); |
228 } | 232 } |
229 } | 233 } |
OLD | NEW |