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

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller.h

Issue 2671923002: mash: Cleanup ash shelf application menu code. (Closed)
Patch Set: Add comments Created 3 years, 10 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "ash/common/shelf/shelf_item_delegate.h" 12 #include "ash/common/shelf/shelf_item_delegate.h"
13 #include "ash/common/shelf/shelf_item_types.h" 13 #include "ash/common/shelf/shelf_item_types.h"
14 #include "ash/public/cpp/shelf_application_menu_item.h"
14 #include "ash/public/interfaces/shelf.mojom.h" 15 #include "ash/public/interfaces/shelf.mojom.h"
15 #include "chrome/browser/ui/app_icon_loader.h" 16 #include "chrome/browser/ui/app_icon_loader.h"
16 #include "chrome/browser/ui/app_icon_loader_delegate.h" 17 #include "chrome/browser/ui/app_icon_loader_delegate.h"
17 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" 18 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
18 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h"
19 #include "chrome/browser/ui/ash/launcher/chrome_launcher_types.h" 19 #include "chrome/browser/ui/ash/launcher/chrome_launcher_types.h"
20 #include "chrome/browser/ui/ash/launcher/settings_window_observer.h" 20 #include "chrome/browser/ui/ash/launcher/settings_window_observer.h"
21 #include "mojo/public/cpp/bindings/associated_binding.h" 21 #include "mojo/public/cpp/bindings/associated_binding.h"
22 22
23 class AccountId; 23 class AccountId;
24 class ArcAppDeferredLauncherController; 24 class ArcAppDeferredLauncherController;
25 class BrowserShortcutLauncherItemController; 25 class BrowserShortcutLauncherItemController;
26 class GURL; 26 class GURL;
27 class LauncherControllerHelper; 27 class LauncherControllerHelper;
28 class LauncherItemController; 28 class LauncherItemController;
29 29
30 namespace ash { 30 namespace ash {
31 class WmShelf; 31 class WmShelf;
32 } 32 }
33 33
34 namespace content { 34 namespace content {
35 class WebContents; 35 class WebContents;
36 } 36 }
37 37
38 namespace gfx { 38 namespace gfx {
39 class Image; 39 class Image;
40 } 40 }
41 41
42 namespace ui { 42 namespace ui {
43 class BaseWindow; 43 class BaseWindow;
44 } 44 }
45 45
46 // A list of the elements which makes up a simple menu description.
47 using ChromeLauncherAppMenuItems =
48 std::vector<std::unique_ptr<ChromeLauncherAppMenuItem>>;
49
50 // ChromeLauncherController manages the launcher items needed for content 46 // ChromeLauncherController manages the launcher items needed for content
51 // windows. Launcher items have a type, an optional app id, and a controller. 47 // windows. Launcher items have a type, an optional app id, and a controller.
52 // Implements mojom::ShelfObserver and is a client of mojom::ShelfController. 48 // Implements mojom::ShelfObserver and is a client of mojom::ShelfController.
53 class ChromeLauncherController : public ash::mojom::ShelfObserver, 49 class ChromeLauncherController : public ash::mojom::ShelfObserver,
54 public AppIconLoaderDelegate { 50 public AppIconLoaderDelegate {
55 public: 51 public:
56 // Used to update the state of non plaform apps, as web contents change. 52 // Used to update the state of non plaform apps, as web contents change.
57 enum AppState { 53 enum AppState {
58 APP_STATE_ACTIVE, 54 APP_STATE_ACTIVE,
59 APP_STATE_WINDOW_ACTIVE, 55 APP_STATE_WINDOW_ACTIVE,
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 182
187 // Called when the active user has changed. 183 // Called when the active user has changed.
188 virtual void ActiveUserChanged(const std::string& user_email) = 0; 184 virtual void ActiveUserChanged(const std::string& user_email) = 0;
189 185
190 // Called when a user got added to the session. 186 // Called when a user got added to the session.
191 virtual void AdditionalUserAddedToSession(Profile* profile) = 0; 187 virtual void AdditionalUserAddedToSession(Profile* profile) = 0;
192 188
193 // Get the list of all running incarnations of this item. 189 // Get the list of all running incarnations of this item.
194 // |event_flags| specifies the flags which were set by the event which 190 // |event_flags| specifies the flags which were set by the event which
195 // triggered this menu generation. It can be used to generate different lists. 191 // triggered this menu generation. It can be used to generate different lists.
196 virtual ChromeLauncherAppMenuItems GetApplicationList( 192 virtual ash::ShelfAppMenuItemList GetAppMenuItems(const ash::ShelfItem& item,
197 const ash::ShelfItem& item, 193 int event_flags) = 0;
198 int event_flags) = 0;
199 194
200 // Get the list of all tabs which belong to a certain application type. 195 // Get the list of all tabs which belong to a certain application type.
201 virtual std::vector<content::WebContents*> GetV1ApplicationsFromAppId( 196 virtual std::vector<content::WebContents*> GetV1ApplicationsFromAppId(
202 const std::string& app_id) = 0; 197 const std::string& app_id) = 0;
203 198
204 // Activates a specified shell application by app id and window index. 199 // Activates a specified shell application by app id and window index.
205 virtual void ActivateShellApp(const std::string& app_id, 200 virtual void ActivateShellApp(const std::string& app_id,
206 int window_index) = 0; 201 int window_index) = 0;
207 202
208 // Checks if a given |web_contents| is known to be associated with an 203 // Checks if a given |web_contents| is known to be associated with an
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 // An observer that manages the shelf title and icon for settings windows. 315 // An observer that manages the shelf title and icon for settings windows.
321 SettingsWindowObserver settings_window_observer_; 316 SettingsWindowObserver settings_window_observer_;
322 317
323 // Used to load the images for app items. 318 // Used to load the images for app items.
324 std::vector<std::unique_ptr<AppIconLoader>> app_icon_loaders_; 319 std::vector<std::unique_ptr<AppIconLoader>> app_icon_loaders_;
325 320
326 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); 321 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController);
327 }; 322 };
328 323
329 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ 324 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698