| 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_properties.h" | 7 #include "ash/wm/window_properties.h" |
| 8 #include "ash/wm/window_state.h" | 8 #include "ash/wm/window_state.h" |
| 9 #include "ash/wm/window_state_delegate.h" | 9 #include "ash/wm/window_state_delegate.h" |
| 10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // request (Shift+F4/F4). | 25 // request (Shift+F4/F4). |
| 26 class BrowserWindowStateDelegate : public ash::wm::WindowStateDelegate { | 26 class BrowserWindowStateDelegate : public ash::wm::WindowStateDelegate { |
| 27 public: | 27 public: |
| 28 explicit BrowserWindowStateDelegate(Browser* browser) | 28 explicit BrowserWindowStateDelegate(Browser* browser) |
| 29 : browser_(browser) { | 29 : browser_(browser) { |
| 30 DCHECK(browser_); | 30 DCHECK(browser_); |
| 31 } | 31 } |
| 32 virtual ~BrowserWindowStateDelegate(){} | 32 virtual ~BrowserWindowStateDelegate(){} |
| 33 | 33 |
| 34 // Overridden from ash::wm::WindowStateDelegate. | 34 // Overridden from ash::wm::WindowStateDelegate. |
| 35 virtual bool ToggleFullscreen(ash::wm::WindowState* window_state) OVERRIDE { | 35 virtual bool ToggleFullscreen(ash::wm::WindowState* window_state) override { |
| 36 DCHECK(window_state->IsFullscreen() || window_state->CanMaximize()); | 36 DCHECK(window_state->IsFullscreen() || window_state->CanMaximize()); |
| 37 // Windows which cannot be maximized should not be fullscreened. | 37 // Windows which cannot be maximized should not be fullscreened. |
| 38 if (!window_state->IsFullscreen() && !window_state->CanMaximize()) | 38 if (!window_state->IsFullscreen() && !window_state->CanMaximize()) |
| 39 return true; | 39 return true; |
| 40 chrome::ToggleFullscreenMode(browser_); | 40 chrome::ToggleFullscreenMode(browser_); |
| 41 return true; | 41 return true; |
| 42 } | 42 } |
| 43 private: | 43 private: |
| 44 Browser* browser_; // not owned. | 44 Browser* browser_; // not owned. |
| 45 | 45 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 /////////////////////////////////////////////////////////////////////////////// | 149 /////////////////////////////////////////////////////////////////////////////// |
| 150 // BrowserFrameAsh, private: | 150 // BrowserFrameAsh, private: |
| 151 | 151 |
| 152 void BrowserFrameAsh::SetWindowAutoManaged() { | 152 void BrowserFrameAsh::SetWindowAutoManaged() { |
| 153 if (!browser_view_->browser()->is_type_popup() || | 153 if (!browser_view_->browser()->is_type_popup() || |
| 154 browser_view_->browser()->is_app()) { | 154 browser_view_->browser()->is_app()) { |
| 155 ash::wm::GetWindowState(GetNativeWindow())-> | 155 ash::wm::GetWindowState(GetNativeWindow())-> |
| 156 set_window_position_managed(true); | 156 set_window_position_managed(true); |
| 157 } | 157 } |
| 158 } | 158 } |
| OLD | NEW |