Chromium Code Reviews| Index: chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.h |
| diff --git a/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.h b/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.h |
| index 8c41068c34cc7222ad319cabc923dc772aff883e..5513ddcc81906d786bb517675d753809b81e10ce 100644 |
| --- a/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.h |
| +++ b/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.h |
| @@ -8,6 +8,8 @@ |
| #include "base/macros.h" |
| #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" |
| #include "chrome/browser/ui/browser_list.h" |
| +#include "content/public/browser/notification_observer.h" |
| +#include "content/public/browser/notification_registrar.h" |
| namespace ash { |
| class ShelfModel; |
| @@ -17,15 +19,12 @@ namespace content { |
| class WebContents; |
| } |
| -namespace gfx { |
| -class Image; |
| -} |
| - |
| -class Browser; |
| class ChromeLauncherController; |
| // Item controller for an browser shortcut. |
|
James Cook
2017/03/01 19:50:48
super nit: while you're here, can you update/clari
msw
2017/03/02 02:59:20
Done.
|
| -class BrowserShortcutLauncherItemController : public LauncherItemController { |
| +class BrowserShortcutLauncherItemController |
| + : public LauncherItemController, |
| + public content::NotificationObserver { |
| public: |
| BrowserShortcutLauncherItemController(ChromeLauncherController* controller, |
| ash::ShelfModel* shelf_model); |
| @@ -48,20 +47,10 @@ class BrowserShortcutLauncherItemController : public LauncherItemController { |
| int64_t display_id, |
| ash::ShelfLaunchSource source) override; |
| ash::ShelfAppMenuItemList GetAppMenuItems(int event_flags) override; |
| + void ExecuteCommand(uint32_t command_id, int32_t event_flags) override; |
| void Close() override; |
| private: |
| - // Get the favicon for the browser list entry for |web_contents|. |
| - // Note that for incognito windows the incognito icon will be returned. |
| - gfx::Image GetBrowserListIcon(content::WebContents* web_contents) const; |
| - |
| - // Get the title for the browser list entry for |web_contents|. |
| - // If |web_contents| has not loaded, returns "Net Tab". |
| - base::string16 GetBrowserListTitle(content::WebContents* web_contents) const; |
| - |
| - // Check if the given |web_contents| is in incognito mode. |
| - bool IsIncognito(content::WebContents* web_contents) const; |
| - |
| // Activate a browser - or advance to the next one on the list. |
| // Returns the action performed. Should be one of SHELF_ACTION_NONE, |
| // SHELF_ACTION_WINDOW_ACTIVATED, or SHELF_ACTION_NEW_WINDOW_CREATED. |
| @@ -74,8 +63,19 @@ class BrowserShortcutLauncherItemController : public LauncherItemController { |
| // Get a list of active browsers. |
| BrowserList::BrowserVector GetListOfActiveBrowsers(); |
| + // content::NotificationObserver: |
| + void Observe(int type, |
| + const content::NotificationSource& source, |
| + const content::NotificationDetails& details) override; |
| + |
| ash::ShelfModel* shelf_model_; |
| + // The cached list of open browser windows shown in an application menu. |
| + BrowserList::BrowserVector browser_menu_items_; |
| + |
| + // Registers for notifications of closing browser windows. |
| + content::NotificationRegistrar registrar_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(BrowserShortcutLauncherItemController); |
| }; |