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

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

Issue 2878133002: mash: Serialize ShelfIDs for property conversion and transport. (Closed)
Patch Set: Address comments. Created 3 years, 7 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
Index: chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc b/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc
index 414b768c7cbe947bdea28f1d60ef8a5015d57503..fbf6bd2e293ab78573abb0828c14fd19c6048457 100644
--- a/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc
+++ b/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc
@@ -121,7 +121,7 @@ void ExtensionAppWindowLauncherController::RegisterApp(AppWindow* app_window) {
const ash::ShelfID shelf_id = GetShelfId(app_window);
DCHECK(!shelf_id.IsNull());
aura::Window* window = app_window->GetNativeWindow();
- window->SetProperty(ash::kShelfIDKey, new ash::ShelfID(shelf_id));
+ window->SetProperty(ash::kShelfIDKey, new std::string(shelf_id.Serialize()));
// Windows created by IME extension should be treated the same way as the
// virtual keyboard window, which does not register itself in launcher.
@@ -153,7 +153,7 @@ void ExtensionAppWindowLauncherController::RegisterApp(AppWindow* app_window) {
controller->AddAppWindow(app_window);
// Check for any existing pinned shelf item with a matching |shelf_id|.
- if (owner()->GetItem(shelf_id) == nullptr) {
+ if (!owner()->GetItem(shelf_id)) {
owner()->CreateAppLauncherItem(std::move(controller), status);
// Restore any existing app icon and flag as set.
if (app_window->HasCustomIcon() && !app_window->app_icon().IsEmpty()) {

Powered by Google App Engine
This is Rietveld 408576698