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

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

Issue 2773493002: [Merge M58] arc: Fix regression in handling ARC shelf item. (Closed)
Patch Set: resolve merge conflicts and adopt to M58 Created 3 years, 9 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 4
5 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller .h" 5 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller .h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" 10 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 } 45 }
46 46
47 if (task_ids_.empty()) { 47 if (task_ids_.empty()) {
48 NOTREACHED(); 48 NOTREACHED();
49 return ash::SHELF_ACTION_NONE; 49 return ash::SHELF_ACTION_NONE;
50 } 50 }
51 arc::SetTaskActive(*task_ids_.begin()); 51 arc::SetTaskActive(*task_ids_.begin());
52 return ash::SHELF_ACTION_NEW_WINDOW_CREATED; 52 return ash::SHELF_ACTION_NEW_WINDOW_CREATED;
53 } 53 }
54 54
55 void ArcAppWindowLauncherItemController::ExecuteCommand(uint32_t command_id,
56 int32_t event_flags) {
57 ActivateIndexedApp(command_id);
58 }
59
55 ash::ShelfAppMenuItemList ArcAppWindowLauncherItemController::GetAppMenuItems( 60 ash::ShelfAppMenuItemList ArcAppWindowLauncherItemController::GetAppMenuItems(
56 int event_flags) { 61 int event_flags) {
57 ash::ShelfAppMenuItemList items; 62 ash::ShelfAppMenuItemList items;
58 base::string16 app_title = LauncherControllerHelper::GetAppTitle( 63 base::string16 app_title = LauncherControllerHelper::GetAppTitle(
59 launcher_controller()->profile(), app_id()); 64 launcher_controller()->profile(), app_id());
60 for (auto it = windows().begin(); it != windows().end(); ++it) { 65 for (auto it = windows().begin(); it != windows().end(); ++it) {
61 // TODO(khmel): resolve correct icon here. 66 // TODO(khmel): resolve correct icon here.
62 size_t i = std::distance(windows().begin(), it); 67 size_t i = std::distance(windows().begin(), it);
63 gfx::Image image; 68 gfx::Image image;
64 aura::Window* window = (*it)->GetNativeWindow(); 69 aura::Window* window = (*it)->GetNativeWindow();
65 items.push_back(base::MakeUnique<ash::ShelfApplicationMenuItem>( 70 items.push_back(base::MakeUnique<ash::ShelfApplicationMenuItem>(
66 base::checked_cast<uint32_t>(i), 71 base::checked_cast<uint32_t>(i),
67 ((window && !window->GetTitle().empty()) ? window->GetTitle() 72 ((window && !window->GetTitle().empty()) ? window->GetTitle()
68 : app_title), 73 : app_title),
69 &image)); 74 &image));
70 } 75 }
71 return items; 76 return items;
72 } 77 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698