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/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" | 9 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" |
10 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" | 10 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 ash::ShelfMenuModel* ArcAppWindowLauncherItemController::CreateApplicationMenu( | 41 ash::ShelfMenuModel* ArcAppWindowLauncherItemController::CreateApplicationMenu( |
42 int event_flags) { | 42 int event_flags) { |
43 return new LauncherApplicationMenuItemModel(GetApplicationList(event_flags)); | 43 return new LauncherApplicationMenuItemModel(GetApplicationList(event_flags)); |
44 } | 44 } |
45 | 45 |
46 ChromeLauncherAppMenuItems | 46 ChromeLauncherAppMenuItems |
47 ArcAppWindowLauncherItemController::GetApplicationList(int event_flags) { | 47 ArcAppWindowLauncherItemController::GetApplicationList(int event_flags) { |
48 ChromeLauncherAppMenuItems items = | 48 ChromeLauncherAppMenuItems items = |
49 AppWindowLauncherItemController::GetApplicationList(event_flags); | 49 AppWindowLauncherItemController::GetApplicationList(event_flags); |
50 size_t i = 0; | 50 for (auto it = windows().begin(); it != windows().end(); ++it) { |
51 for (auto it = windows().begin(); it != windows().end(); ++it, ++i) { | |
52 // TODO(khmel): resolve correct icon here. | 51 // TODO(khmel): resolve correct icon here. |
| 52 size_t i = std::distance(windows().begin(), it); |
53 gfx::Image image; | 53 gfx::Image image; |
54 aura::Window* window = (*it)->GetNativeWindow(); | 54 aura::Window* window = (*it)->GetNativeWindow(); |
55 items.push_back(new ChromeLauncherAppMenuItemV2App( | 55 items.push_back(new ChromeLauncherAppMenuItemV2App( |
56 (window ? window->title() : GetTitle()), &image, app_id(), | 56 ((window && !window->title().empty()) ? window->title() : GetTitle()), |
57 launcher_controller(), i, i == 0 /* has_leading_separator */)); | 57 &image, app_id(), launcher_controller(), i, |
| 58 i == 0 /* has_leading_separator */)); |
58 } | 59 } |
59 return items; | 60 return items; |
60 } | 61 } |
OLD | NEW |