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

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

Issue 2900783003: Handle app custom icon via aura::Window property. (Closed)
Patch Set: nits Created 3 years, 6 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" 4 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h"
5 5
6 #include <string> 6 #include <string>
7 7
8 #include "ash/display/screen_orientation_controller_chromeos.h" 8 #include "ash/display/screen_orientation_controller_chromeos.h"
9 #include "ash/public/cpp/window_properties.h" 9 #include "ash/public/cpp/window_properties.h"
10 #include "ash/shared/app_types.h" 10 #include "ash/shared/app_types.h"
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 const arc::ArcAppShelfId& app_shelf_id = app_window_info.app_shelf_id(); 541 const arc::ArcAppShelfId& app_shelf_id = app_window_info.app_shelf_id();
542 const auto it = app_shelf_group_to_controller_map_.find(app_shelf_id); 542 const auto it = app_shelf_group_to_controller_map_.find(app_shelf_id);
543 if (it != app_shelf_group_to_controller_map_.end()) { 543 if (it != app_shelf_group_to_controller_map_.end()) {
544 DCHECK_EQ(it->second->app_id(), app_shelf_id.ToString()); 544 DCHECK_EQ(it->second->app_id(), app_shelf_id.ToString());
545 it->second->AddTaskId(task_id); 545 it->second->AddTaskId(task_id);
546 return it->second; 546 return it->second;
547 } 547 }
548 548
549 std::unique_ptr<ArcAppWindowLauncherItemController> controller = 549 std::unique_ptr<ArcAppWindowLauncherItemController> controller =
550 base::MakeUnique<ArcAppWindowLauncherItemController>( 550 base::MakeUnique<ArcAppWindowLauncherItemController>(
551 app_shelf_id.ToString(), owner()); 551 app_shelf_id.ToString());
552 ArcAppWindowLauncherItemController* item_controller = controller.get(); 552 ArcAppWindowLauncherItemController* item_controller = controller.get();
553 const ash::ShelfID shelf_id(app_shelf_id.ToString()); 553 const ash::ShelfID shelf_id(app_shelf_id.ToString());
554 if (!owner()->GetItem(shelf_id)) { 554 if (!owner()->GetItem(shelf_id)) {
555 owner()->CreateAppLauncherItem(std::move(controller), ash::STATUS_RUNNING); 555 owner()->CreateAppLauncherItem(std::move(controller), ash::STATUS_RUNNING);
556 } else { 556 } else {
557 owner()->shelf_model()->SetShelfItemDelegate(shelf_id, 557 owner()->shelf_model()->SetShelfItemDelegate(shelf_id,
558 std::move(controller)); 558 std::move(controller));
559 owner()->SetItemStatus(shelf_id, ash::STATUS_RUNNING); 559 owner()->SetItemStatus(shelf_id, ash::STATUS_RUNNING);
560 } 560 }
561 item_controller->AddTaskId(task_id); 561 item_controller->AddTaskId(task_id);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 const std::string* arc_app_id = exo::ShellSurface::GetApplicationId(window); 628 const std::string* arc_app_id = exo::ShellSurface::GetApplicationId(window);
629 if (!arc_app_id) 629 if (!arc_app_id)
630 return -1; 630 return -1;
631 631
632 int task_id = -1; 632 int task_id = -1;
633 if (sscanf(arc_app_id->c_str(), "org.chromium.arc.%d", &task_id) != 1) 633 if (sscanf(arc_app_id->c_str(), "org.chromium.arc.%d", &task_id) != 1)
634 return -1; 634 return -1;
635 635
636 return task_id; 636 return task_id;
637 } 637 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698