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

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

Issue 2243573002: ARC: Show window title in launcher menu instead of app title (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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"
11 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_v2app.h" 11 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_v2app.h"
12 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" 12 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
13 #include "chrome/browser/ui/ash/launcher/launcher_application_menu_item_model.h" 13 #include "chrome/browser/ui/ash/launcher/launcher_application_menu_item_model.h"
14 #include "ui/aura/window.h"
15 #include "ui/base/base_window.h"
14 16
15 ArcAppWindowLauncherItemController::ArcAppWindowLauncherItemController( 17 ArcAppWindowLauncherItemController::ArcAppWindowLauncherItemController(
16 const std::string& arc_app_id, 18 const std::string& arc_app_id,
17 ChromeLauncherController* controller) 19 ChromeLauncherController* controller)
18 : AppWindowLauncherItemController(TYPE_APP, 20 : AppWindowLauncherItemController(TYPE_APP,
19 arc_app_id, 21 arc_app_id,
20 arc_app_id, 22 arc_app_id,
21 controller) {} 23 controller) {}
22 24
23 ArcAppWindowLauncherItemController::~ArcAppWindowLauncherItemController() {} 25 ArcAppWindowLauncherItemController::~ArcAppWindowLauncherItemController() {}
(...skipping 14 matching lines...) Expand all
38 40
39 ash::ShelfMenuModel* ArcAppWindowLauncherItemController::CreateApplicationMenu( 41 ash::ShelfMenuModel* ArcAppWindowLauncherItemController::CreateApplicationMenu(
40 int event_flags) { 42 int event_flags) {
41 return new LauncherApplicationMenuItemModel(GetApplicationList(event_flags)); 43 return new LauncherApplicationMenuItemModel(GetApplicationList(event_flags));
42 } 44 }
43 45
44 ChromeLauncherAppMenuItems 46 ChromeLauncherAppMenuItems
45 ArcAppWindowLauncherItemController::GetApplicationList(int event_flags) { 47 ArcAppWindowLauncherItemController::GetApplicationList(int event_flags) {
46 ChromeLauncherAppMenuItems items = 48 ChromeLauncherAppMenuItems items =
47 AppWindowLauncherItemController::GetApplicationList(event_flags); 49 AppWindowLauncherItemController::GetApplicationList(event_flags);
48 for (size_t i = 0; i < windows().size(); ++i) { 50 size_t i = 0;
51 for (auto it = windows().begin(); it != windows().end(); ++it, ++i) {
James Cook 2016/08/17 21:41:33 Dumb question: windows() always has an even number
yoshiki 2016/08/23 08:23:56 The second incremented variable is not "it" but "i
oshima 2016/08/23 19:03:08 FYI: you can get the index by "itr - windows().beg
49 // TODO(khmel): resolve correct icon here. 52 // TODO(khmel): resolve correct icon here.
50 gfx::Image image; 53 gfx::Image image;
54 aura::Window* window = (*it)->GetNativeWindow();
51 items.push_back(new ChromeLauncherAppMenuItemV2App( 55 items.push_back(new ChromeLauncherAppMenuItemV2App(
52 GetTitle(), &image, app_id(), launcher_controller(), i, 56 (window ? window->title() : GetTitle()), &image, app_id(),
Mr4D (OOO till 08-26) 2016/08/11 18:46:57 Would it make sense to use GetTitle() if the windo
yoshiki 2016/08/11 19:41:57 Yes. I think showing empty title is weird and shou
oshima 2016/08/16 17:57:18 Did you implement this?
53 i == 0 /* has_leading_separator */)); 57 launcher_controller(), i, i == 0 /* has_leading_separator */));
54 } 58 }
55 return items; 59 return items;
56 } 60 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698