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

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

Issue 10918103: Give platform apps control over launcher right-click context menu. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/ash/launcher/chrome_launcher_controller.h" 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/launcher/launcher_model.h" 10 #include "ash/launcher/launcher_model.h"
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 ash::LauncherID ChromeLauncherController::GetLauncherIDForAppID( 352 ash::LauncherID ChromeLauncherController::GetLauncherIDForAppID(
353 const std::string& app_id) { 353 const std::string& app_id) {
354 for (IDToItemMap::const_iterator i = id_to_item_map_.begin(); 354 for (IDToItemMap::const_iterator i = id_to_item_map_.begin();
355 i != id_to_item_map_.end(); ++i) { 355 i != id_to_item_map_.end(); ++i) {
356 if (i->second.app_id == app_id) 356 if (i->second.app_id == app_id)
357 return i->first; 357 return i->first;
358 } 358 }
359 return 0; 359 return 0;
360 } 360 }
361 361
362 std::string ChromeLauncherController::GetAppIDForLauncherID(
363 ash::LauncherID id) {
364 DCHECK(id_to_item_map_.find(id) != id_to_item_map_.end());
365 return id_to_item_map_[id].app_id;
366 }
367
362 void ChromeLauncherController::SetAppImage(const std::string& id, 368 void ChromeLauncherController::SetAppImage(const std::string& id,
363 const gfx::ImageSkia& image) { 369 const gfx::ImageSkia& image) {
364 // TODO: need to get this working for shortcuts. 370 // TODO: need to get this working for shortcuts.
365 371
366 for (IDToItemMap::const_iterator i = id_to_item_map_.begin(); 372 for (IDToItemMap::const_iterator i = id_to_item_map_.begin();
367 i != id_to_item_map_.end(); ++i) { 373 i != id_to_item_map_.end(); ++i) {
368 if (i->second.app_id != id) 374 if (i->second.app_id != id)
369 continue; 375 continue;
370 376
371 // Panel items may share the same app_id as the app that created them, 377 // Panel items may share the same app_id as the app that created them,
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
937 } 943 }
938 944
939 void ChromeLauncherController::StopLoadingAnimation() { 945 void ChromeLauncherController::StopLoadingAnimation() {
940 DCHECK(observed_sync_service_); 946 DCHECK(observed_sync_service_);
941 947
942 model_->SetStatus(ash::LauncherModel::STATUS_NORMAL); 948 model_->SetStatus(ash::LauncherModel::STATUS_NORMAL);
943 loading_timer_.Stop(); 949 loading_timer_.Stop();
944 observed_sync_service_->RemoveObserver(this); 950 observed_sync_service_->RemoveObserver(this);
945 observed_sync_service_ = NULL; 951 observed_sync_service_ = NULL;
946 } 952 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698