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/app_list/arc/arc_app_utils.h" | 10 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 NOTREACHED(); | 39 NOTREACHED(); |
40 return kNoAction; | 40 return kNoAction; |
41 } | 41 } |
42 arc::SetTaskActive(*task_ids_.begin()); | 42 arc::SetTaskActive(*task_ids_.begin()); |
43 return kNewWindowCreated; | 43 return kNewWindowCreated; |
44 } | 44 } |
45 } | 45 } |
46 | 46 |
47 base::string16 ArcAppWindowLauncherItemController::GetTitle() { | 47 base::string16 ArcAppWindowLauncherItemController::GetTitle() { |
48 ArcAppListPrefs* arc_prefs = | 48 ArcAppListPrefs* arc_prefs = |
49 ArcAppListPrefs::Get(launcher_controller()->GetProfile()); | 49 ArcAppListPrefs::Get(launcher_controller()->profile()); |
50 DCHECK(arc_prefs); | 50 DCHECK(arc_prefs); |
51 std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = arc_prefs->GetApp( | 51 std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = arc_prefs->GetApp( |
52 ArcAppWindowLauncherController::GetArcAppIdFromShelfAppId(app_id())); | 52 ArcAppWindowLauncherController::GetArcAppIdFromShelfAppId(app_id())); |
53 if (!app_info) { | 53 if (!app_info) { |
54 NOTREACHED(); | 54 NOTREACHED(); |
55 return base::string16(); | 55 return base::string16(); |
56 } | 56 } |
57 | 57 |
58 return base::UTF8ToUTF16(app_info->name); | 58 return base::UTF8ToUTF16(app_info->name); |
59 } | 59 } |
(...skipping 12 matching lines...) Expand all Loading... |
72 size_t i = std::distance(windows().begin(), it); | 72 size_t i = std::distance(windows().begin(), it); |
73 gfx::Image image; | 73 gfx::Image image; |
74 aura::Window* window = (*it)->GetNativeWindow(); | 74 aura::Window* window = (*it)->GetNativeWindow(); |
75 items.push_back(new ChromeLauncherAppMenuItemV2App( | 75 items.push_back(new ChromeLauncherAppMenuItemV2App( |
76 ((window && !window->title().empty()) ? window->title() : GetTitle()), | 76 ((window && !window->title().empty()) ? window->title() : GetTitle()), |
77 &image, app_id(), launcher_controller(), i, | 77 &image, app_id(), launcher_controller(), i, |
78 i == 0 /* has_leading_separator */)); | 78 i == 0 /* has_leading_separator */)); |
79 } | 79 } |
80 return items; | 80 return items; |
81 } | 81 } |
OLD | NEW |