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

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

Issue 11451019: Remove TabContents from ui/ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 8 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_PER_APP_H_ 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_PER_APP_H_
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_PER_APP_H_ 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_PER_APP_H_
7 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 13 matching lines...) Expand all
24 #include "content/public/browser/notification_observer.h" 24 #include "content/public/browser/notification_observer.h"
25 #include "content/public/browser/notification_registrar.h" 25 #include "content/public/browser/notification_registrar.h"
26 #include "ui/aura/window_observer.h" 26 #include "ui/aura/window_observer.h"
27 27
28 class AppSyncUIState; 28 class AppSyncUIState;
29 class Browser; 29 class Browser;
30 class BrowserLauncherItemControllerTest; 30 class BrowserLauncherItemControllerTest;
31 class LauncherItemController; 31 class LauncherItemController;
32 class Profile; 32 class Profile;
33 class ShellWindowLauncherController; 33 class ShellWindowLauncherController;
34 class TabContents;
35 34
36 namespace ash { 35 namespace ash {
37 class LauncherModel; 36 class LauncherModel;
38 } 37 }
39 38
40 namespace aura { 39 namespace aura {
41 class Window; 40 class Window;
42 } 41 }
43 42
44 namespace content { 43 namespace content {
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 // behavior on |root_window|. 196 // behavior on |root_window|.
198 virtual bool CanUserModifyShelfAutoHideBehavior( 197 virtual bool CanUserModifyShelfAutoHideBehavior(
199 aura::RootWindow* root_window) const OVERRIDE; 198 aura::RootWindow* root_window) const OVERRIDE;
200 199
201 // Toggles the shelf auto-hide behavior on |root_window|. Does nothing if the 200 // Toggles the shelf auto-hide behavior on |root_window|. Does nothing if the
202 // user is not allowed to modify the auto-hide behavior. 201 // user is not allowed to modify the auto-hide behavior.
203 virtual void ToggleShelfAutoHideBehavior( 202 virtual void ToggleShelfAutoHideBehavior(
204 aura::RootWindow* root_window) OVERRIDE; 203 aura::RootWindow* root_window) OVERRIDE;
205 204
206 // The tab no longer represents its previously identified application. 205 // The tab no longer represents its previously identified application.
207 virtual void RemoveTabFromRunningApp(TabContents* tab, 206 virtual void RemoveTabFromRunningApp(content::WebContents* tab,
208 const std::string& app_id) OVERRIDE; 207 const std::string& app_id) OVERRIDE;
209 208
210 // Notify the controller that the state of an non platform app's tabs 209 // Notify the controller that the state of an non platform app's tabs
211 // have changed, 210 // have changed,
212 virtual void UpdateAppState(content::WebContents* contents, 211 virtual void UpdateAppState(content::WebContents* contents,
213 AppState app_state) OVERRIDE; 212 AppState app_state) OVERRIDE;
214 213
215 // Limits application refocusing to urls that match |url| for |id|. 214 // Limits application refocusing to urls that match |url| for |id|.
216 virtual void SetRefocusURLPattern(ash::LauncherID id, 215 virtual void SetRefocusURLPattern(ash::LauncherID id,
217 const GURL& url) OVERRIDE; 216 const GURL& url) OVERRIDE;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 virtual void SetAppTabHelperForTest(AppTabHelper* helper) OVERRIDE; 266 virtual void SetAppTabHelperForTest(AppTabHelper* helper) OVERRIDE;
268 virtual void SetAppIconLoaderForTest(AppIconLoader* loader) OVERRIDE; 267 virtual void SetAppIconLoaderForTest(AppIconLoader* loader) OVERRIDE;
269 virtual const std::string& GetAppIdFromLauncherIdForTest( 268 virtual const std::string& GetAppIdFromLauncherIdForTest(
270 ash::LauncherID id) OVERRIDE; 269 ash::LauncherID id) OVERRIDE;
271 270
272 private: 271 private:
273 friend class ChromeLauncherControllerPerAppTest; 272 friend class ChromeLauncherControllerPerAppTest;
274 273
275 typedef std::map<ash::LauncherID, LauncherItemController*> 274 typedef std::map<ash::LauncherID, LauncherItemController*>
276 IDToItemControllerMap; 275 IDToItemControllerMap;
277 typedef std::list<TabContents*> TabContentsList; 276 typedef std::list<content::WebContents*> WebContentsList;
278 typedef std::map<std::string, TabContentsList> AppIDToTabContentsListMap; 277 typedef std::map<std::string, WebContentsList> AppIDToWebContentsListMap;
279 typedef std::map<TabContents*, std::string> TabContentsToAppIDMap; 278 typedef std::map<content::WebContents*, std::string> WebContentsToAppIDMap;
280 279
281 // Returns the profile used for new windows. 280 // Returns the profile used for new windows.
282 Profile* GetProfileForNewWindows(); 281 Profile* GetProfileForNewWindows();
283 282
284 // Invoked when the associated browser or app is closed. 283 // Invoked when the associated browser or app is closed.
285 void LauncherItemClosed(ash::LauncherID id); 284 void LauncherItemClosed(ash::LauncherID id);
286 285
287 // Internal helpers for pinning and unpinning that handle both 286 // Internal helpers for pinning and unpinning that handle both
288 // client-triggered and internal pinning operations. 287 // client-triggered and internal pinning operations.
289 void DoPinAppWithID(const std::string& app_id); 288 void DoPinAppWithID(const std::string& app_id);
290 void DoUnpinAppsWithID(const std::string& app_id); 289 void DoUnpinAppsWithID(const std::string& app_id);
291 290
292 // Re-syncs launcher model with prefs::kPinnedLauncherApps. 291 // Re-syncs launcher model with prefs::kPinnedLauncherApps.
293 void UpdateAppLaunchersFromPref(); 292 void UpdateAppLaunchersFromPref();
294 293
295 // Persists the shelf auto-hide behavior to prefs. 294 // Persists the shelf auto-hide behavior to prefs.
296 void SetShelfAutoHideBehaviorPrefs(ash::ShelfAutoHideBehavior behavior, 295 void SetShelfAutoHideBehaviorPrefs(ash::ShelfAutoHideBehavior behavior,
297 aura::RootWindow* root_window); 296 aura::RootWindow* root_window);
298 297
299 // Sets the shelf auto-hide behavior from prefs. 298 // Sets the shelf auto-hide behavior from prefs.
300 void SetShelfAutoHideBehaviorFromPrefs(); 299 void SetShelfAutoHideBehaviorFromPrefs();
301 300
302 // Sets the shelf alignment from prefs. 301 // Sets the shelf alignment from prefs.
303 void SetShelfAlignmentFromPrefs(); 302 void SetShelfAlignmentFromPrefs();
304 303
305 // Returns the most recently active tab contents for an app. 304 // Returns the most recently active web contents for an app.
306 TabContents* GetLastActiveTabContents(const std::string& app_id); 305 content::WebContents* GetLastActiveWebContents(const std::string& app_id);
307 306
308 // Creates an app launcher to insert at |index|. Note that |index| may be 307 // Creates an app launcher to insert at |index|. Note that |index| may be
309 // adjusted by the model to meet ordering constraints. 308 // adjusted by the model to meet ordering constraints.
310 ash::LauncherID InsertAppLauncherItem( 309 ash::LauncherID InsertAppLauncherItem(
311 LauncherItemController* controller, 310 LauncherItemController* controller,
312 const std::string& app_id, 311 const std::string& app_id,
313 ash::LauncherItemStatus status, 312 ash::LauncherItemStatus status,
314 int index); 313 int index);
315 314
316 bool HasItemController(ash::LauncherID id) const; 315 bool HasItemController(ash::LauncherID id) const;
317 316
318 ash::LauncherModel* model_; 317 ash::LauncherModel* model_;
319 318
320 // Profile used for prefs and loading extensions. This is NOT necessarily the 319 // Profile used for prefs and loading extensions. This is NOT necessarily the
321 // profile new windows are created with. 320 // profile new windows are created with.
322 Profile* profile_; 321 Profile* profile_;
323 322
324 IDToItemControllerMap id_to_item_controller_map_; 323 IDToItemControllerMap id_to_item_controller_map_;
325 324
326 // Maintains activation order of tab contents for each app. 325 // Maintains activation order of web contents for each app.
327 AppIDToTabContentsListMap app_id_to_tab_contents_list_; 326 AppIDToWebContentsListMap app_id_to_web_contents_list_;
328 327
329 // Direct access to app_id for a tab contents. 328 // Direct access to app_id for a web contents.
330 TabContentsToAppIDMap tab_contents_to_app_id_; 329 WebContentsToAppIDMap web_contents_to_app_id_;
331 330
332 // Used to track shell windows. 331 // Used to track shell windows.
333 scoped_ptr<ShellWindowLauncherController> shell_window_controller_; 332 scoped_ptr<ShellWindowLauncherController> shell_window_controller_;
334 333
335 // Used to get app info for tabs. 334 // Used to get app info for tabs.
336 scoped_ptr<AppTabHelper> app_tab_helper_; 335 scoped_ptr<AppTabHelper> app_tab_helper_;
337 336
338 // Used to load the image for an app item. 337 // Used to load the image for an app item.
339 scoped_ptr<AppIconLoader> app_icon_loader_; 338 scoped_ptr<AppIconLoader> app_icon_loader_;
340 339
341 content::NotificationRegistrar notification_registrar_; 340 content::NotificationRegistrar notification_registrar_;
342 341
343 PrefChangeRegistrar pref_change_registrar_; 342 PrefChangeRegistrar pref_change_registrar_;
344 343
345 AppSyncUIState* app_sync_ui_state_; 344 AppSyncUIState* app_sync_ui_state_;
346 345
347 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerPerApp); 346 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerPerApp);
348 }; 347 };
349 348
350 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_PER_APP_H_ 349 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_PER_APP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698