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

Side by Side Diff: chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_BROWSER_SHORTCUT_LAUNCHER_ITEM_CONTROLLER _H_ 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_BROWSER_SHORTCUT_LAUNCHER_ITEM_CONTROLLER _H_
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_BROWSER_SHORTCUT_LAUNCHER_ITEM_CONTROLLER _H_ 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_BROWSER_SHORTCUT_LAUNCHER_ITEM_CONTROLLER _H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" 9 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h"
10 #include "chrome/browser/ui/browser_list.h" 10 #include "chrome/browser/ui/browser_list.h"
(...skipping 25 matching lines...) Expand all
36 void UpdateBrowserItemState(); 36 void UpdateBrowserItemState();
37 37
38 // Sets the shelf id for the browser window if the browser is represented. 38 // Sets the shelf id for the browser window if the browser is represented.
39 void SetShelfIDForBrowserWindowContents(Browser* browser, 39 void SetShelfIDForBrowserWindowContents(Browser* browser,
40 content::WebContents* web_contents); 40 content::WebContents* web_contents);
41 41
42 // Check if there is any active browsers windows. 42 // Check if there is any active browsers windows.
43 bool IsListOfActiveBrowserEmpty(); 43 bool IsListOfActiveBrowserEmpty();
44 44
45 // LauncherItemController overrides: 45 // LauncherItemController overrides:
46 ShelfItemDelegate::PerformedAction Activate( 46 ash::ShelfAction ItemSelected(ui::EventType event_type,
47 ash::LaunchSource source) override; 47 int event_flags,
48 ash::ShelfItemDelegate::PerformedAction ItemSelected( 48 int64_t display_id,
49 const ui::Event& event) override; 49 ash::ShelfLaunchSource source) override;
50 ash::ShelfAppMenuItemList GetAppMenuItems(int event_flags) override; 50 ash::ShelfAppMenuItemList GetAppMenuItems(int event_flags) override;
51 void Close() override; 51 void Close() override;
52 52
53 private: 53 private:
54 // Get the favicon for the browser list entry for |web_contents|. 54 // Get the favicon for the browser list entry for |web_contents|.
55 // Note that for incognito windows the incognito icon will be returned. 55 // Note that for incognito windows the incognito icon will be returned.
56 gfx::Image GetBrowserListIcon(content::WebContents* web_contents) const; 56 gfx::Image GetBrowserListIcon(content::WebContents* web_contents) const;
57 57
58 // Get the title for the browser list entry for |web_contents|. 58 // Get the title for the browser list entry for |web_contents|.
59 // If |web_contents| has not loaded, returns "Net Tab". 59 // If |web_contents| has not loaded, returns "Net Tab".
60 base::string16 GetBrowserListTitle(content::WebContents* web_contents) const; 60 base::string16 GetBrowserListTitle(content::WebContents* web_contents) const;
61 61
62 // Check if the given |web_contents| is in incognito mode. 62 // Check if the given |web_contents| is in incognito mode.
63 bool IsIncognito(content::WebContents* web_contents) const; 63 bool IsIncognito(content::WebContents* web_contents) const;
64 64
65 // Activate a browser - or advance to the next one on the list. 65 // Activate a browser - or advance to the next one on the list.
66 // Returns the action performed. Should be one of kNoAction, 66 // Returns the action performed. Should be one of SHELF_ACTION_NONE,
67 // kExistingWindowActivated, or kNewWindowCreated. 67 // SHELF_ACTION_WINDOW_ACTIVATED, or SHELF_ACTION_NEW_WINDOW_CREATED.
68 PerformedAction ActivateOrAdvanceToNextBrowser(); 68 ash::ShelfAction ActivateOrAdvanceToNextBrowser();
69 69
70 // Returns true when the given |browser| is listed in the browser application 70 // Returns true when the given |browser| is listed in the browser application
71 // list. 71 // list.
72 bool IsBrowserRepresentedInBrowserList(Browser* browser); 72 bool IsBrowserRepresentedInBrowserList(Browser* browser);
73 73
74 // Get a list of active browsers. 74 // Get a list of active browsers.
75 BrowserList::BrowserVector GetListOfActiveBrowsers(); 75 BrowserList::BrowserVector GetListOfActiveBrowsers();
76 76
77 ash::ShelfModel* shelf_model_; 77 ash::ShelfModel* shelf_model_;
78 78
79 DISALLOW_COPY_AND_ASSIGN(BrowserShortcutLauncherItemController); 79 DISALLOW_COPY_AND_ASSIGN(BrowserShortcutLauncherItemController);
80 }; 80 };
81 81
82 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_BROWSER_SHORTCUT_LAUNCHER_ITEM_CONTROL LER_H_ 82 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_BROWSER_SHORTCUT_LAUNCHER_ITEM_CONTROL LER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698