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

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

Issue 1849623002: Remove unused ash::SHELF_ALIGNMENT_TOP (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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
« no previous file with comments | « chrome/browser/ui/ash/chrome_launcher_prefs.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 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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 // See comment in |kShelfAlignment| as to why we consider two prefs. 245 // See comment in |kShelfAlignment| as to why we consider two prefs.
246 const std::string alignment_value( 246 const std::string alignment_value(
247 GetPrefForRootWindow(profile->GetPrefs(), 247 GetPrefForRootWindow(profile->GetPrefs(),
248 root_window, 248 root_window,
249 prefs::kShelfAlignmentLocal, 249 prefs::kShelfAlignmentLocal,
250 prefs::kShelfAlignment)); 250 prefs::kShelfAlignment));
251 if (alignment_value == ash::kShelfAlignmentLeft) 251 if (alignment_value == ash::kShelfAlignmentLeft)
252 return ash::SHELF_ALIGNMENT_LEFT; 252 return ash::SHELF_ALIGNMENT_LEFT;
253 else if (alignment_value == ash::kShelfAlignmentRight) 253 else if (alignment_value == ash::kShelfAlignmentRight)
254 return ash::SHELF_ALIGNMENT_RIGHT; 254 return ash::SHELF_ALIGNMENT_RIGHT;
255 else if (alignment_value == ash::kShelfAlignmentTop) 255 // Default to bottom.
256 return ash::SHELF_ALIGNMENT_TOP;
257 return ash::SHELF_ALIGNMENT_BOTTOM; 256 return ash::SHELF_ALIGNMENT_BOTTOM;
258 } 257 }
259 258
260 // If prefs have synced and no user-set value exists at |local_path|, the value 259 // If prefs have synced and no user-set value exists at |local_path|, the value
261 // from |synced_path| is copied to |local_path|. 260 // from |synced_path| is copied to |local_path|.
262 void MaybePropagatePrefToLocal( 261 void MaybePropagatePrefToLocal(
263 syncable_prefs::PrefServiceSyncable* pref_service, 262 syncable_prefs::PrefServiceSyncable* pref_service,
264 const char* local_path, 263 const char* local_path,
265 const char* synced_path) { 264 const char* synced_path) {
266 if (!pref_service->FindPreference(local_path)->HasUserSetting() && 265 if (!pref_service->FindPreference(local_path)->HasUserSetting() &&
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 switch (ash::Shell::GetInstance()->GetShelfAlignment(root_window)) { 1288 switch (ash::Shell::GetInstance()->GetShelfAlignment(root_window)) {
1290 case ash::SHELF_ALIGNMENT_BOTTOM: 1289 case ash::SHELF_ALIGNMENT_BOTTOM:
1291 pref_value = ash::kShelfAlignmentBottom; 1290 pref_value = ash::kShelfAlignmentBottom;
1292 break; 1291 break;
1293 case ash::SHELF_ALIGNMENT_LEFT: 1292 case ash::SHELF_ALIGNMENT_LEFT:
1294 pref_value = ash::kShelfAlignmentLeft; 1293 pref_value = ash::kShelfAlignmentLeft;
1295 break; 1294 break;
1296 case ash::SHELF_ALIGNMENT_RIGHT: 1295 case ash::SHELF_ALIGNMENT_RIGHT:
1297 pref_value = ash::kShelfAlignmentRight; 1296 pref_value = ash::kShelfAlignmentRight;
1298 break; 1297 break;
1299 case ash::SHELF_ALIGNMENT_TOP:
1300 pref_value = ash::kShelfAlignmentTop;
1301 } 1298 }
1302 1299
1303 UpdatePerDisplayPref( 1300 UpdatePerDisplayPref(
1304 profile_->GetPrefs(), root_window, prefs::kShelfAlignment, pref_value); 1301 profile_->GetPrefs(), root_window, prefs::kShelfAlignment, pref_value);
1305 1302
1306 if (root_window == ash::Shell::GetPrimaryRootWindow()) { 1303 if (root_window == ash::Shell::GetPrimaryRootWindow()) {
1307 // See comment in |kShelfAlignment| about why we have two prefs here. 1304 // See comment in |kShelfAlignment| about why we have two prefs here.
1308 profile_->GetPrefs()->SetString(prefs::kShelfAlignmentLocal, pref_value); 1305 profile_->GetPrefs()->SetString(prefs::kShelfAlignmentLocal, pref_value);
1309 profile_->GetPrefs()->SetString(prefs::kShelfAlignment, pref_value); 1306 profile_->GetPrefs()->SetString(prefs::kShelfAlignment, pref_value);
1310 } 1307 }
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
2241 2238
2242 AppIconLoader* ChromeLauncherController::GetAppIconLoaderForApp( 2239 AppIconLoader* ChromeLauncherController::GetAppIconLoaderForApp(
2243 const std::string& app_id) { 2240 const std::string& app_id) {
2244 for (const auto& app_icon_loader : app_icon_loaders_) { 2241 for (const auto& app_icon_loader : app_icon_loaders_) {
2245 if (app_icon_loader->CanLoadImageForApp(app_id)) 2242 if (app_icon_loader->CanLoadImageForApp(app_id))
2246 return app_icon_loader.get(); 2243 return app_icon_loader.get();
2247 } 2244 }
2248 2245
2249 return nullptr; 2246 return nullptr;
2250 } 2247 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/chrome_launcher_prefs.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698