Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(609)

Side by Side Diff: ash/frame/custom_frame_view_ash.cc

Issue 198413003: Enable immersive fullscreen on Windows Ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix issues from previous review comment. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ash/shelf/shelf_layout_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ash/frame/custom_frame_view_ash.h" 5 #include "ash/frame/custom_frame_view_ash.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" 8 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h"
9 #include "ash/frame/caption_buttons/frame_maximize_button.h" 9 #include "ash/frame/caption_buttons/frame_maximize_button.h"
10 #include "ash/frame/caption_buttons/frame_maximize_button_observer.h" 10 #include "ash/frame/caption_buttons/frame_maximize_button_observer.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // windows. 48 // windows.
49 class CustomFrameViewAshWindowStateDelegate 49 class CustomFrameViewAshWindowStateDelegate
50 : public ash::wm::WindowStateDelegate, 50 : public ash::wm::WindowStateDelegate,
51 public ash::wm::WindowStateObserver, 51 public ash::wm::WindowStateObserver,
52 public aura::WindowObserver { 52 public aura::WindowObserver {
53 public: 53 public:
54 CustomFrameViewAshWindowStateDelegate( 54 CustomFrameViewAshWindowStateDelegate(
55 ash::wm::WindowState* window_state, 55 ash::wm::WindowState* window_state,
56 ash::CustomFrameViewAsh* custom_frame_view) 56 ash::CustomFrameViewAsh* custom_frame_view)
57 : window_state_(NULL) { 57 : window_state_(NULL) {
58 #if defined(OS_CHROMEOS)
59 // TODO(pkotwicz): Investigate if immersive fullscreen can be enabled for
60 // Windows Ash.
61 immersive_fullscreen_controller_.reset( 58 immersive_fullscreen_controller_.reset(
62 new ash::ImmersiveFullscreenController); 59 new ash::ImmersiveFullscreenController);
63 custom_frame_view->InitImmersiveFullscreenControllerForView( 60 custom_frame_view->InitImmersiveFullscreenControllerForView(
64 immersive_fullscreen_controller_.get()); 61 immersive_fullscreen_controller_.get());
65 62
66 // Add a window state observer to exit fullscreen properly in case 63 // Add a window state observer to exit fullscreen properly in case
67 // fullscreen is exited without going through 64 // fullscreen is exited without going through
68 // WindowState::ToggleFullscreen(). This is the case when exiting 65 // WindowState::ToggleFullscreen(). This is the case when exiting
69 // immersive fullscreen via the "Restore" window control. 66 // immersive fullscreen via the "Restore" window control.
70 // TODO(pkotwicz): This is a hack. Remove ASAP. http://crbug.com/319048 67 // TODO(pkotwicz): This is a hack. Remove ASAP. http://crbug.com/319048
71 window_state_ = window_state; 68 window_state_ = window_state;
72 window_state_->AddObserver(this); 69 window_state_->AddObserver(this);
73 window_state_->window()->AddObserver(this); 70 window_state_->window()->AddObserver(this);
74 #endif
75 } 71 }
76 virtual ~CustomFrameViewAshWindowStateDelegate() { 72 virtual ~CustomFrameViewAshWindowStateDelegate() {
77 if (window_state_) { 73 if (window_state_) {
78 window_state_->RemoveObserver(this); 74 window_state_->RemoveObserver(this);
79 window_state_->window()->RemoveObserver(this); 75 window_state_->window()->RemoveObserver(this);
80 } 76 }
81 } 77 }
82 private: 78 private:
83 // Overridden from ash::wm::WindowStateDelegate: 79 // Overridden from ash::wm::WindowStateDelegate:
84 virtual bool ToggleFullscreen(ash::wm::WindowState* window_state) OVERRIDE { 80 virtual bool ToggleFullscreen(ash::wm::WindowState* window_state) OVERRIDE {
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 } 505 }
510 506
511 //////////////////////////////////////////////////////////////////////////////// 507 ////////////////////////////////////////////////////////////////////////////////
512 // CustomFrameViewAsh, private: 508 // CustomFrameViewAsh, private:
513 509
514 int CustomFrameViewAsh::NonClientTopBorderHeight() const { 510 int CustomFrameViewAsh::NonClientTopBorderHeight() const {
515 return frame_->IsFullscreen() ? 0 : header_view_->GetPreferredHeight(); 511 return frame_->IsFullscreen() ? 0 : header_view_->GetPreferredHeight();
516 } 512 }
517 513
518 } // namespace ash 514 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/shelf/shelf_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698