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

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc

Issue 308683002: Move MaximizeModeWindowManager to the controller (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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
OLDNEW
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/ash/launcher/chrome_launcher_controller.h" 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
6 6
7 #include <algorithm>
jonross 2014/05/29 15:24:42 cpplint
7 #include <vector> 8 #include <vector>
8 9
9 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
10 #include "ash/desktop_background/desktop_background_controller.h" 11 #include "ash/desktop_background/desktop_background_controller.h"
11 #include "ash/multi_profile_uma.h" 12 #include "ash/multi_profile_uma.h"
12 #include "ash/root_window_controller.h" 13 #include "ash/root_window_controller.h"
13 #include "ash/shelf/shelf.h" 14 #include "ash/shelf/shelf.h"
14 #include "ash/shelf/shelf_item_delegate_manager.h" 15 #include "ash/shelf/shelf_item_delegate_manager.h"
15 #include "ash/shelf/shelf_layout_manager.h" 16 #include "ash/shelf/shelf_layout_manager.h"
16 #include "ash/shelf/shelf_model.h" 17 #include "ash/shelf/shelf_model.h"
17 #include "ash/shelf/shelf_widget.h" 18 #include "ash/shelf/shelf_widget.h"
18 #include "ash/shell.h" 19 #include "ash/shell.h"
19 #include "ash/system/tray/system_tray_delegate.h" 20 #include "ash/system/tray/system_tray_delegate.h"
21 #include "ash/wm/maximize_mode/maximize_mode_controller.h"
20 #include "ash/wm/window_util.h" 22 #include "ash/wm/window_util.h"
21 #include "base/command_line.h" 23 #include "base/command_line.h"
22 #include "base/prefs/scoped_user_pref_update.h" 24 #include "base/prefs/scoped_user_pref_update.h"
23 #include "base/strings/string_number_conversions.h" 25 #include "base/strings/string_number_conversions.h"
24 #include "base/strings/utf_string_conversions.h" 26 #include "base/strings/utf_string_conversions.h"
25 #include "base/values.h" 27 #include "base/values.h"
26 #include "chrome/browser/app_mode/app_mode_utils.h" 28 #include "chrome/browser/app_mode/app_mode_utils.h"
27 #include "chrome/browser/chrome_notification_types.h" 29 #include "chrome/browser/chrome_notification_types.h"
28 #include "chrome/browser/defaults.h" 30 #include "chrome/browser/defaults.h"
29 #include "chrome/browser/extensions/app_icon_loader_impl.h" 31 #include "chrome/browser/extensions/app_icon_loader_impl.h"
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 // the set of values that may be encountered includes the now-extinct 902 // the set of values that may be encountered includes the now-extinct
901 // "Default" as well as "Never" and "Always", "Default" should now 903 // "Default" as well as "Never" and "Always", "Default" should now
902 // be treated as "Never" (http://crbug.com/146773). 904 // be treated as "Never" (http://crbug.com/146773).
903 if (behavior_value == ash::kShelfAutoHideBehaviorAlways) 905 if (behavior_value == ash::kShelfAutoHideBehaviorAlways)
904 return ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS; 906 return ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS;
905 return ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER; 907 return ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER;
906 } 908 }
907 909
908 bool ChromeLauncherController::CanUserModifyShelfAutoHideBehavior( 910 bool ChromeLauncherController::CanUserModifyShelfAutoHideBehavior(
909 aura::Window* root_window) const { 911 aura::Window* root_window) const {
910 return !ash::Shell::GetInstance()->IsMaximizeModeWindowManagerEnabled() && 912 return !ash::Shell::GetInstance()->maximize_mode_controller()->
913 IsMaximizeModeWindowManagerEnabled() &&
911 profile_->GetPrefs()->FindPreference( 914 profile_->GetPrefs()->FindPreference(
912 prefs::kShelfAutoHideBehaviorLocal)->IsUserModifiable(); 915 prefs::kShelfAutoHideBehaviorLocal)->IsUserModifiable();
913 } 916 }
914 917
915 void ChromeLauncherController::ToggleShelfAutoHideBehavior( 918 void ChromeLauncherController::ToggleShelfAutoHideBehavior(
916 aura::Window* root_window) { 919 aura::Window* root_window) {
917 ash::ShelfAutoHideBehavior behavior = GetShelfAutoHideBehavior(root_window) == 920 ash::ShelfAutoHideBehavior behavior = GetShelfAutoHideBehavior(root_window) ==
918 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS ? 921 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS ?
919 ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER : 922 ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER :
920 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS; 923 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS;
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after
2005 } 2008 }
2006 2009
2007 void ChromeLauncherController::ReleaseProfile() { 2010 void ChromeLauncherController::ReleaseProfile() {
2008 if (app_sync_ui_state_) 2011 if (app_sync_ui_state_)
2009 app_sync_ui_state_->RemoveObserver(this); 2012 app_sync_ui_state_->RemoveObserver(this);
2010 2013
2011 PrefServiceSyncable::FromProfile(profile_)->RemoveObserver(this); 2014 PrefServiceSyncable::FromProfile(profile_)->RemoveObserver(this);
2012 2015
2013 pref_change_registrar_.RemoveAll(); 2016 pref_change_registrar_.RemoveAll();
2014 } 2017 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698