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

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

Issue 2769323002: mash: Update shelf pin prefs in ShelfModelObserver overrides. (Closed)
Patch Set: Use ScopedPinSyncDisabler name suggestion. Created 3 years, 8 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 "ash/public/interfaces/constants.mojom.h" 7 #include "ash/public/interfaces/constants.mojom.h"
8 #include "base/auto_reset.h"
9 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
10 #include "chrome/browser/chromeos/arc/arc_util.h" 9 #include "chrome/browser/chromeos/arc/arc_util.h"
11 #include "chrome/browser/extensions/extension_app_icon_loader.h" 10 #include "chrome/browser/extensions/extension_app_icon_loader.h"
12 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/ui/app_list/arc/arc_app_icon_loader.h" 12 #include "chrome/browser/ui/app_list/arc/arc_app_icon_loader.h"
14 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" 13 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h"
15 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h" 14 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h"
16 #include "content/public/common/service_manager_connection.h" 15 #include "content/public/common/service_manager_connection.h"
17 #include "services/service_manager/public/cpp/connector.h" 16 #include "services/service_manager/public/cpp/connector.h"
18 #include "ui/display/display.h" 17 #include "ui/display/display.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 ash::launcher::GetShelfAlignmentPref(prefs, display.id()), 94 ash::launcher::GetShelfAlignmentPref(prefs, display.id()),
96 display.id()); 95 display.id());
97 } 96 }
98 } 97 }
99 98
100 void ChromeLauncherController::SetShelfBehaviorsFromPrefs() { 99 void ChromeLauncherController::SetShelfBehaviorsFromPrefs() {
101 SetShelfAutoHideBehaviorFromPrefs(); 100 SetShelfAutoHideBehaviorFromPrefs();
102 SetShelfAlignmentFromPrefs(); 101 SetShelfAlignmentFromPrefs();
103 } 102 }
104 103
104 ChromeLauncherController::ScopedPinSyncDisabler
105 ChromeLauncherController::GetScopedPinSyncDisabler() {
106 // Only one temporary disabler should not exist at a time.
107 DCHECK(should_sync_pin_changes_);
108 return base::MakeUnique<base::AutoReset<bool>>(&should_sync_pin_changes_,
109 false);
110 }
111
105 void ChromeLauncherController::SetLauncherControllerHelperForTest( 112 void ChromeLauncherController::SetLauncherControllerHelperForTest(
106 std::unique_ptr<LauncherControllerHelper> helper) { 113 std::unique_ptr<LauncherControllerHelper> helper) {
107 launcher_controller_helper_ = std::move(helper); 114 launcher_controller_helper_ = std::move(helper);
108 } 115 }
109 116
110 void ChromeLauncherController::SetAppIconLoadersForTest( 117 void ChromeLauncherController::SetAppIconLoadersForTest(
111 std::vector<std::unique_ptr<AppIconLoader>>& loaders) { 118 std::vector<std::unique_ptr<AppIconLoader>>& loaders) {
112 app_icon_loaders_.clear(); 119 app_icon_loaders_.clear();
113 for (auto& loader : loaders) 120 for (auto& loader : loaders)
114 app_icon_loaders_.push_back(std::move(loader)); 121 app_icon_loaders_.push_back(std::move(loader));
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 // This will uselessly store a preference value for invalid display ids. 189 // This will uselessly store a preference value for invalid display ids.
183 ash::launcher::SetShelfAutoHideBehaviorPref(profile_->GetPrefs(), display_id, 190 ash::launcher::SetShelfAutoHideBehaviorPref(profile_->GetPrefs(), display_id,
184 auto_hide); 191 auto_hide);
185 } 192 }
186 193
187 void ChromeLauncherController::OnAppImageUpdated(const std::string& app_id, 194 void ChromeLauncherController::OnAppImageUpdated(const std::string& app_id,
188 const gfx::ImageSkia& image) { 195 const gfx::ImageSkia& image) {
189 // Implemented by subclasses; this should not be called. 196 // Implemented by subclasses; this should not be called.
190 NOTREACHED(); 197 NOTREACHED();
191 } 198 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698