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

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

Issue 1349783006: Cleanup: Pass std::string as const reference if possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert third_party changes Created 5 years, 3 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 <vector> 7 #include <vector>
8 8
9 #include "ash/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/desktop_background/desktop_background_controller.h" 10 #include "ash/desktop_background/desktop_background_controller.h"
(...skipping 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after
1275 // Make sure that there is a controller associated with the id and that the 1275 // Make sure that there is a controller associated with the id and that the
1276 // extension itself is a valid application and not a panel. 1276 // extension itself is a valid application and not a panel.
1277 LauncherItemController* controller = GetLauncherItemController(item.id); 1277 LauncherItemController* controller = GetLauncherItemController(item.id);
1278 if (!controller || !GetShelfIDForAppID(controller->app_id())) 1278 if (!controller || !GetShelfIDForAppID(controller->app_id()))
1279 return ChromeLauncherAppMenuItems().Pass(); 1279 return ChromeLauncherAppMenuItems().Pass();
1280 1280
1281 return controller->GetApplicationList(event_flags); 1281 return controller->GetApplicationList(event_flags);
1282 } 1282 }
1283 1283
1284 std::vector<content::WebContents*> 1284 std::vector<content::WebContents*>
1285 ChromeLauncherController::GetV1ApplicationsFromAppId(std::string app_id) { 1285 ChromeLauncherController::GetV1ApplicationsFromAppId(
1286 const std::string& app_id) {
1286 ash::ShelfID id = GetShelfIDForAppID(app_id); 1287 ash::ShelfID id = GetShelfIDForAppID(app_id);
1287 1288
1288 // If there is no such an item pinned to the launcher, no menu gets created. 1289 // If there is no such an item pinned to the launcher, no menu gets created.
1289 if (id) { 1290 if (id) {
1290 LauncherItemController* controller = GetLauncherItemController(id); 1291 LauncherItemController* controller = GetLauncherItemController(id);
1291 DCHECK(controller); 1292 DCHECK(controller);
1292 if (controller->type() == LauncherItemController::TYPE_SHORTCUT) 1293 if (controller->type() == LauncherItemController::TYPE_SHORTCUT)
1293 return GetV1ApplicationsFromController(controller); 1294 return GetV1ApplicationsFromController(controller);
1294 } 1295 }
1295 return std::vector<content::WebContents*>(); 1296 return std::vector<content::WebContents*>();
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
2103 void ChromeLauncherController::ReleaseProfile() { 2104 void ChromeLauncherController::ReleaseProfile() {
2104 if (app_sync_ui_state_) 2105 if (app_sync_ui_state_)
2105 app_sync_ui_state_->RemoveObserver(this); 2106 app_sync_ui_state_->RemoveObserver(this);
2106 2107
2107 extensions::ExtensionRegistry::Get(profile_)->RemoveObserver(this); 2108 extensions::ExtensionRegistry::Get(profile_)->RemoveObserver(this);
2108 2109
2109 PrefServiceSyncableFromProfile(profile_)->RemoveObserver(this); 2110 PrefServiceSyncableFromProfile(profile_)->RemoveObserver(this);
2110 2111
2111 pref_change_registrar_.RemoveAll(); 2112 pref_change_registrar_.RemoveAll();
2112 } 2113 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698