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

Unified Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.cc

Issue 2341643002: Enhance chrome.app.window API for shelf integration with pinning support (cont.) (Closed)
Patch Set: Unit Test Fix Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.cc
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.cc
index 26d3abadaff2e8c48f065a27fdcc92d339e60823..562dd7cf4282497694c5ea9a995997a8d94b612c 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.h"
+#include "base/strings/string_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/ash/chrome_launcher_prefs.h"
@@ -268,6 +269,12 @@ ChromeLauncherControllerMus::GetArcDeferredLauncher() {
return nullptr;
}
+const std::string& ChromeLauncherControllerMus::GetLaunchIDForShelfID(
+ ash::ShelfID id) {
+ NOTIMPLEMENTED();
+ return base::EmptyString();
+}
+
void ChromeLauncherControllerMus::OnAppImageUpdated(
const std::string& app_id,
const gfx::ImageSkia& image) {
@@ -284,31 +291,29 @@ void ChromeLauncherControllerMus::PinAppsFromPrefs() {
launcher_controller_helper());
for (const auto& app_launcher_id : pinned_apps) {
- const std::string app_launcher_id_str = app_launcher_id.ToString();
- if (app_launcher_id_str == ash::launcher::kPinnedAppsPlaceholder)
+ const std::string app_id = app_launcher_id.app_id();
+ if (app_launcher_id.ToString() == ash::launcher::kPinnedAppsPlaceholder)
continue;
ash::mojom::ShelfItemPtr item(ash::mojom::ShelfItem::New());
- item->app_id = app_launcher_id_str;
- item->app_title =
- mojo::String::From(launcher_controller_helper()->GetAppTitle(
- profile(), app_launcher_id_str));
+ item->app_id = app_id;
+ item->app_title = mojo::String::From(
+ launcher_controller_helper()->GetAppTitle(profile(), app_id));
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
const gfx::Image& image = rb.GetImageNamed(IDR_APP_DEFAULT_ICON);
item->image = *image.ToSkBitmap();
std::unique_ptr<ChromeShelfItemDelegate> delegate(
- new ChromeShelfItemDelegate(app_launcher_id_str, this));
+ new ChromeShelfItemDelegate(app_id, this));
shelf_controller()->PinItem(std::move(item),
delegate->CreateInterfacePtrInfoAndBind(
shelf_controller().associated_group()));
app_id_to_item_delegate_.insert(
- std::make_pair(app_launcher_id_str, std::move(delegate)));
+ std::make_pair(app_id, std::move(delegate)));
- AppIconLoader* app_icon_loader =
- GetAppIconLoaderForApp(app_launcher_id_str);
+ AppIconLoader* app_icon_loader = GetAppIconLoaderForApp(app_id);
if (app_icon_loader) {
- app_icon_loader->FetchImage(app_launcher_id_str);
- app_icon_loader->UpdateImage(app_launcher_id_str);
+ app_icon_loader->FetchImage(app_id);
+ app_icon_loader->UpdateImage(app_id);
}
}
}
« no previous file with comments | « chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698