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

Side by Side Diff: chrome/browser/ui/views/frame/immersive_mode_controller_ash.cc

Issue 32943006: [Refactor] Replace kFullscreenUsesMinimalChromeKey with WindowState::hide_shelf_when_fullscreen() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 1 month 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 | « chrome/browser/ui/ash/chrome_shell_delegate_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/immersive_mode_controller_ash.h" 5 #include "chrome/browser/ui/views/frame/immersive_mode_controller_ash.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
11 #include "ash/shell.h" 11 #include "ash/shell.h"
12 #include "ash/wm/window_properties.h" 12 #include "ash/wm/window_state.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "chrome/browser/chrome_notification_types.h" 14 #include "chrome/browser/chrome_notification_types.h"
15 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" 15 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h"
16 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" 16 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
17 #include "chrome/browser/ui/views/frame/top_container_view.h" 17 #include "chrome/browser/ui/views/frame/top_container_view.h"
18 #include "content/public/browser/notification_service.h" 18 #include "content/public/browser/notification_service.h"
19 #include "content/public/browser/web_contents.h" 19 #include "content/public/browser/web_contents.h"
20 #include "content/public/browser/web_contents_view.h" 20 #include "content/public/browser/web_contents_view.h"
21 #include "ui/aura/client/activation_client.h" 21 #include "ui/aura/client/activation_client.h"
22 #include "ui/aura/client/aura_constants.h" 22 #include "ui/aura/client/aura_constants.h"
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 return false; 907 return false;
908 } 908 }
909 909
910 void ImmersiveModeControllerAsh::UpdateUseMinimalChrome(Layout layout) { 910 void ImmersiveModeControllerAsh::UpdateUseMinimalChrome(Layout layout) {
911 // May be NULL in tests. 911 // May be NULL in tests.
912 FullscreenController* fullscreen_controller = 912 FullscreenController* fullscreen_controller =
913 delegate_->GetFullscreenController(); 913 delegate_->GetFullscreenController();
914 bool in_tab_fullscreen = fullscreen_controller ? 914 bool in_tab_fullscreen = fullscreen_controller ?
915 fullscreen_controller->IsFullscreenForTabOrPending() : false; 915 fullscreen_controller->IsFullscreenForTabOrPending() : false;
916 bool use_minimal_chrome = !in_tab_fullscreen && enabled_; 916 bool use_minimal_chrome = !in_tab_fullscreen && enabled_;
917 native_window_->SetProperty(ash::internal::kFullscreenUsesMinimalChromeKey, 917
918 use_minimal_chrome); 918 // When using minimal chrome, the shelf is auto-hidden. The auto-hidden shelf
919 // displays a 3px 'light bar' when it is closed. Otherwise, the shelf is
920 // hidden completely and cannot be revealed.
921 ash::wm::GetWindowState(native_window_)->set_hide_shelf_when_fullscreen(
922 !use_minimal_chrome);
919 923
920 TabIndicatorVisibility previous_tab_indicator_visibility = 924 TabIndicatorVisibility previous_tab_indicator_visibility =
921 tab_indicator_visibility_; 925 tab_indicator_visibility_;
922 if (tab_indicator_visibility_ != TAB_INDICATORS_FORCE_HIDE) { 926 if (tab_indicator_visibility_ != TAB_INDICATORS_FORCE_HIDE) {
923 tab_indicator_visibility_ = use_minimal_chrome ? 927 tab_indicator_visibility_ = use_minimal_chrome ?
924 TAB_INDICATORS_SHOW : TAB_INDICATORS_HIDE; 928 TAB_INDICATORS_SHOW : TAB_INDICATORS_HIDE;
925 } 929 }
926 930
927 // Ash on Windows may not have a shell. 931 ash::Shell::GetInstance()->UpdateShelfVisibility();
928 if (ash::Shell::HasInstance()) {
929 // When using minimal chrome, the shelf is auto-hidden. The auto-hidden
930 // shelf displays a 3px 'light bar' when it is closed.
931 ash::Shell::GetInstance()->UpdateShelfVisibility();
932 }
933 932
934 if (tab_indicator_visibility_ != previous_tab_indicator_visibility) { 933 if (tab_indicator_visibility_ != previous_tab_indicator_visibility) {
935 // If the top-of-window views are revealed or animating, the change will 934 // If the top-of-window views are revealed or animating, the change will
936 // take effect with the layout once the top-of-window views are closed. 935 // take effect with the layout once the top-of-window views are closed.
937 if (layout == LAYOUT_YES && reveal_state_ == CLOSED) 936 if (layout == LAYOUT_YES && reveal_state_ == CLOSED)
938 LayoutBrowserRootView(); 937 LayoutBrowserRootView();
939 } 938 }
940 } 939 }
941 940
942 int ImmersiveModeControllerAsh::GetAnimationDuration(Animate animate) const { 941 int ImmersiveModeControllerAsh::GetAnimationDuration(Animate animate) const {
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 aura::Window* transient_child = transient_children[i]; 1154 aura::Window* transient_child = transient_children[i];
1156 views::BubbleDelegateView* bubble_delegate = 1155 views::BubbleDelegateView* bubble_delegate =
1157 AsBubbleDelegate(transient_child); 1156 AsBubbleDelegate(transient_child);
1158 if (bubble_delegate && 1157 if (bubble_delegate &&
1159 bubble_delegate->GetAnchorView() && 1158 bubble_delegate->GetAnchorView() &&
1160 top_container_->Contains(bubble_delegate->GetAnchorView())) { 1159 top_container_->Contains(bubble_delegate->GetAnchorView())) {
1161 bubble_manager_->StartObserving(transient_child); 1160 bubble_manager_->StartObserving(transient_child);
1162 } 1161 }
1163 } 1162 }
1164 } 1163 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/chrome_shell_delegate_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698