| OLD | NEW |
| 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" |
| 11 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" | 11 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" |
| 12 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" | 12 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" |
| 13 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_v2app.h" | |
| 14 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 13 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| 15 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h" | 14 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h" |
| 16 #include "ui/aura/window.h" | 15 #include "ui/aura/window.h" |
| 17 #include "ui/base/base_window.h" | 16 #include "ui/base/base_window.h" |
| 18 | 17 |
| 19 ArcAppWindowLauncherItemController::ArcAppWindowLauncherItemController( | 18 ArcAppWindowLauncherItemController::ArcAppWindowLauncherItemController( |
| 20 const std::string& arc_app_id, | 19 const std::string& arc_app_id, |
| 21 ChromeLauncherController* controller) | 20 ChromeLauncherController* controller) |
| 22 : AppWindowLauncherItemController(arc_app_id, std::string(), controller) {} | 21 : AppWindowLauncherItemController(arc_app_id, std::string(), controller) {} |
| 23 | 22 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 ash::ShelfAppMenuItemList ArcAppWindowLauncherItemController::GetAppMenuItems( | 55 ash::ShelfAppMenuItemList ArcAppWindowLauncherItemController::GetAppMenuItems( |
| 57 int event_flags) { | 56 int event_flags) { |
| 58 ash::ShelfAppMenuItemList items; | 57 ash::ShelfAppMenuItemList items; |
| 59 base::string16 app_title = LauncherControllerHelper::GetAppTitle( | 58 base::string16 app_title = LauncherControllerHelper::GetAppTitle( |
| 60 launcher_controller()->profile(), app_id()); | 59 launcher_controller()->profile(), app_id()); |
| 61 for (auto it = windows().begin(); it != windows().end(); ++it) { | 60 for (auto it = windows().begin(); it != windows().end(); ++it) { |
| 62 // TODO(khmel): resolve correct icon here. | 61 // TODO(khmel): resolve correct icon here. |
| 63 size_t i = std::distance(windows().begin(), it); | 62 size_t i = std::distance(windows().begin(), it); |
| 64 gfx::Image image; | 63 gfx::Image image; |
| 65 aura::Window* window = (*it)->GetNativeWindow(); | 64 aura::Window* window = (*it)->GetNativeWindow(); |
| 66 items.push_back(base::MakeUnique<ChromeLauncherAppMenuItemV2App>( | 65 items.push_back(base::MakeUnique<ash::ShelfApplicationMenuItem>( |
| 66 base::checked_cast<uint32_t>(i), |
| 67 ((window && !window->GetTitle().empty()) ? window->GetTitle() | 67 ((window && !window->GetTitle().empty()) ? window->GetTitle() |
| 68 : app_title), | 68 : app_title), |
| 69 &image, app_id(), launcher_controller(), i)); | 69 &image)); |
| 70 } | 70 } |
| 71 return items; | 71 return items; |
| 72 } | 72 } |
| OLD | NEW |