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

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

Issue 2696073002: Merge ShelfItemDelegate::ItemSelected & LauncherItemDelegate::Activate. (Closed)
Patch Set: nit 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/cpp/shelf_application_menu_item.h"
15 #include "ash/public/interfaces/shelf.mojom.h" 15 #include "ash/public/interfaces/shelf.mojom.h"
16 #include "chrome/browser/ui/app_icon_loader.h" 16 #include "chrome/browser/ui/app_icon_loader.h"
17 #include "chrome/browser/ui/app_icon_loader_delegate.h" 17 #include "chrome/browser/ui/app_icon_loader_delegate.h"
18 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" 18 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
19 #include "chrome/browser/ui/ash/app_launcher_id.h" 19 #include "chrome/browser/ui/ash/app_launcher_id.h"
20 #include "chrome/browser/ui/ash/launcher/chrome_launcher_types.h"
21 #include "chrome/browser/ui/ash/launcher/settings_window_observer.h" 20 #include "chrome/browser/ui/ash/launcher/settings_window_observer.h"
22 #include "mojo/public/cpp/bindings/associated_binding.h" 21 #include "mojo/public/cpp/bindings/associated_binding.h"
23 22
24 class AccountId; 23 class AccountId;
25 class ArcAppDeferredLauncherController; 24 class ArcAppDeferredLauncherController;
26 class BrowserShortcutLauncherItemController; 25 class BrowserShortcutLauncherItemController;
27 class GURL; 26 class GURL;
28 class LauncherControllerHelper; 27 class LauncherControllerHelper;
29 class LauncherItemController; 28 class LauncherItemController;
30 29
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 130
132 // Returns true if the specified item is open. 131 // Returns true if the specified item is open.
133 virtual bool IsOpen(ash::ShelfID id) = 0; 132 virtual bool IsOpen(ash::ShelfID id) = 0;
134 133
135 // Returns true if the specified item is for a platform app. 134 // Returns true if the specified item is for a platform app.
136 virtual bool IsPlatformApp(ash::ShelfID id) = 0; 135 virtual bool IsPlatformApp(ash::ShelfID id) = 0;
137 136
138 // Opens a new instance of the application identified by the AppLauncherId. 137 // Opens a new instance of the application identified by the AppLauncherId.
139 // Used by the app-list, and by pinned-app shelf items. 138 // Used by the app-list, and by pinned-app shelf items.
140 void LaunchApp(ash::AppLauncherId id, 139 void LaunchApp(ash::AppLauncherId id,
141 ash::LaunchSource source, 140 ash::ShelfLaunchSource source,
142 int event_flags); 141 int event_flags);
143 142
144 // If |app_id| is running, reactivates the app's most recently active window, 143 // If |app_id| is running, reactivates the app's most recently active window,
145 // otherwise launches and activates the app. 144 // otherwise launches and activates the app.
146 // Used by the app-list, and by pinned-app shelf items. 145 // Used by the app-list, and by pinned-app shelf items.
147 virtual void ActivateApp(const std::string& app_id, 146 virtual void ActivateApp(const std::string& app_id,
148 ash::LaunchSource source, 147 ash::ShelfLaunchSource source,
149 int event_flags) = 0; 148 int event_flags) = 0;
150 149
151 // Set the image for a specific shelf item (e.g. when set by the app). 150 // Set the image for a specific shelf item (e.g. when set by the app).
152 virtual void SetLauncherItemImage(ash::ShelfID shelf_id, 151 virtual void SetLauncherItemImage(ash::ShelfID shelf_id,
153 const gfx::ImageSkia& image) = 0; 152 const gfx::ImageSkia& image) = 0;
154 153
155 // Notify the controller that the state of an non platform app's tabs 154 // Notify the controller that the state of an non platform app's tabs
156 // have changed, 155 // have changed,
157 virtual void UpdateAppState(content::WebContents* contents, 156 virtual void UpdateAppState(content::WebContents* contents,
158 AppState app_state) = 0; 157 AppState app_state) = 0;
159 158
160 // Returns ShelfID for |contents|. If |contents| is not an app or is not 159 // Returns ShelfID for |contents|. If |contents| is not an app or is not
161 // pinned, returns the id of browser shrotcut. 160 // pinned, returns the id of browser shrotcut.
162 virtual ash::ShelfID GetShelfIDForWebContents( 161 virtual ash::ShelfID GetShelfIDForWebContents(
163 content::WebContents* contents) = 0; 162 content::WebContents* contents) = 0;
164 163
165 // Limits application refocusing to urls that match |url| for |id|. 164 // Limits application refocusing to urls that match |url| for |id|.
166 virtual void SetRefocusURLPatternForTest(ash::ShelfID id, 165 virtual void SetRefocusURLPatternForTest(ash::ShelfID id,
167 const GURL& url) = 0; 166 const GURL& url) = 0;
168 167
169 // Activates a |window|. If |allow_minimize| is true and the system allows 168 // Activates a |window|. If |allow_minimize| is true and the system allows
170 // it, the the window will get minimized instead. 169 // it, the the window will get minimized instead.
171 // Returns the action performed. Should be one of kNoAction, 170 // Returns the action performed. Should be one of SHELF_ACTION_NONE,
172 // kExistingWindowActivated, or kExistingWindowMinimized. 171 // SHELF_ACTION_WINDOW_ACTIVATED, or SHELF_ACTION_WINDOW_MINIMIZED.
173 virtual ash::ShelfItemDelegate::PerformedAction 172 virtual ash::ShelfAction ActivateWindowOrMinimizeIfActive(
174 ActivateWindowOrMinimizeIfActive(ui::BaseWindow* window, 173 ui::BaseWindow* window,
175 bool allow_minimize) = 0; 174 bool allow_minimize) = 0;
176 175
177 // Called when the active user has changed. 176 // Called when the active user has changed.
178 virtual void ActiveUserChanged(const std::string& user_email) = 0; 177 virtual void ActiveUserChanged(const std::string& user_email) = 0;
179 178
180 // Called when a user got added to the session. 179 // Called when a user got added to the session.
181 virtual void AdditionalUserAddedToSession(Profile* profile) = 0; 180 virtual void AdditionalUserAddedToSession(Profile* profile) = 0;
182 181
183 // Get the list of all running incarnations of this item. 182 // Get the list of all running incarnations of this item.
184 // |event_flags| specifies the flags which were set by the event which 183 // |event_flags| specifies the flags which were set by the event which
185 // triggered this menu generation. It can be used to generate different lists. 184 // triggered this menu generation. It can be used to generate different lists.
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 // An observer that manages the shelf title and icon for settings windows. 308 // An observer that manages the shelf title and icon for settings windows.
310 SettingsWindowObserver settings_window_observer_; 309 SettingsWindowObserver settings_window_observer_;
311 310
312 // Used to load the images for app items. 311 // Used to load the images for app items.
313 std::vector<std::unique_ptr<AppIconLoader>> app_icon_loaders_; 312 std::vector<std::unique_ptr<AppIconLoader>> app_icon_loaders_;
314 313
315 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); 314 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController);
316 }; 315 };
317 316
318 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ 317 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698