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

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

Issue 23606016: Refactor LauncherItemController and LauncherItemDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for LauncherTest and observing LauncherModel in DelegateManager Created 7 years, 3 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 (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_APP_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_APP_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_APP_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_APP_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 15 matching lines...) Expand all
26 // Item controller for an app shortcut. Shortcuts track app and launcher ids, 26 // Item controller for an app shortcut. Shortcuts track app and launcher ids,
27 // but do not have any associated windows (opening a shortcut will replace the 27 // but do not have any associated windows (opening a shortcut will replace the
28 // item with the appropriate LauncherItemController type). 28 // item with the appropriate LauncherItemController type).
29 class AppShortcutLauncherItemController : public LauncherItemController { 29 class AppShortcutLauncherItemController : public LauncherItemController {
30 public: 30 public:
31 AppShortcutLauncherItemController(const std::string& app_id, 31 AppShortcutLauncherItemController(const std::string& app_id,
32 ChromeLauncherController* controller); 32 ChromeLauncherController* controller);
33 33
34 virtual ~AppShortcutLauncherItemController(); 34 virtual ~AppShortcutLauncherItemController();
35 35
36 std::vector<content::WebContents*> GetRunningApplications();
37
36 // LauncherItemController overrides: 38 // LauncherItemController overrides:
37 virtual string16 GetTitle() OVERRIDE;
38 virtual bool IsCurrentlyShownInWindow(aura::Window* window) const OVERRIDE; 39 virtual bool IsCurrentlyShownInWindow(aura::Window* window) const OVERRIDE;
39 virtual bool IsOpen() const OVERRIDE; 40 virtual bool IsOpen() const OVERRIDE;
40 virtual bool IsVisible() const OVERRIDE; 41 virtual bool IsVisible() const OVERRIDE;
41 virtual void Launch(int event_flags) OVERRIDE; 42 virtual void Launch(int event_flags) OVERRIDE;
42 virtual void Activate() OVERRIDE; 43 virtual void Activate() OVERRIDE;
43 virtual void Close() OVERRIDE; 44 virtual void Close() OVERRIDE;
44 virtual void Clicked(const ui::Event& event) OVERRIDE;
45 virtual void OnRemoved() OVERRIDE; 45 virtual void OnRemoved() OVERRIDE;
46 virtual ChromeLauncherAppMenuItems GetApplicationList( 46 virtual ChromeLauncherAppMenuItems GetApplicationList(
47 int event_flags) OVERRIDE; 47 int event_flags) OVERRIDE;
48 std::vector<content::WebContents*> GetRunningApplications(); 48 virtual void ItemSelected(const ui::Event& event) OVERRIDE;
49 virtual base::string16 GetTitle() OVERRIDE;
50 virtual ui::MenuModel* CreateContextMenu(
51 aura::RootWindow* root_window) OVERRIDE;
52 virtual ash::LauncherMenuModel* CreateApplicationMenu(
53 int event_flags) OVERRIDE;
54 virtual bool IsDraggable() OVERRIDE;
55 virtual bool ShouldShowTooltip() OVERRIDE;
49 56
50 // Get the refocus url pattern, which can be used to identify this application 57 // Get the refocus url pattern, which can be used to identify this application
51 // from a URL link. 58 // from a URL link.
52 const GURL& refocus_url() const { return refocus_url_; } 59 const GURL& refocus_url() const { return refocus_url_; }
53 // Set the refocus url pattern. Used by unit tests. 60 // Set the refocus url pattern. Used by unit tests.
54 void set_refocus_url(const GURL& refocus_url) { refocus_url_ = refocus_url; } 61 void set_refocus_url(const GURL& refocus_url) { refocus_url_ = refocus_url; }
55 62
56 private: 63 private:
57 // Get the last running application. 64 // Get the last running application.
58 content::WebContents* GetLRUApplication(); 65 content::WebContents* GetLRUApplication();
(...skipping 23 matching lines...) Expand all
82 // Since V2 applications can be undetectable after launching, this timer is 89 // Since V2 applications can be undetectable after launching, this timer is
83 // keeping track of the last launch attempt. 90 // keeping track of the last launch attempt.
84 base::Time last_launch_attempt_; 91 base::Time last_launch_attempt_;
85 92
86 ChromeLauncherController* chrome_launcher_controller_; 93 ChromeLauncherController* chrome_launcher_controller_;
87 94
88 DISALLOW_COPY_AND_ASSIGN(AppShortcutLauncherItemController); 95 DISALLOW_COPY_AND_ASSIGN(AppShortcutLauncherItemController);
89 }; 96 };
90 97
91 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_APP_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_ H_ 98 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_APP_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698