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

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

Issue 23534022: Handling browser item status in BrowserShortcutLauncherItemController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CreateAppAndBrowserState() 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
« no previous file with comments | « no previous file | chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/ui/ash/launcher/launcher_item_controller.h" 8 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h"
9 9
10 namespace content { 10 namespace content {
11 class WebContents; 11 class WebContents;
12 } 12 }
13 13
14 namespace gfx { 14 namespace gfx {
15 class Image; 15 class Image;
16 } 16 }
17 17
18 class Browser; 18 class Browser;
19 class ChromeLauncherController; 19 class ChromeLauncherController;
20 class Profile; 20 class Profile;
21 21
22 // Item controller for an browser shortcut. 22 // Item controller for an browser shortcut.
23 class BrowserShortcutLauncherItemController : public LauncherItemController { 23 class BrowserShortcutLauncherItemController : public LauncherItemController {
24 public: 24 public:
25 BrowserShortcutLauncherItemController(ChromeLauncherController* controller, 25 BrowserShortcutLauncherItemController(ChromeLauncherController* controller,
26 Profile* profile); 26 Profile* profile);
27 27
28 virtual ~BrowserShortcutLauncherItemController(); 28 virtual ~BrowserShortcutLauncherItemController();
29 29
30 // Updates the activation state of the Broswer item.
31 void UpdateBrowserItemState();
32
30 // LauncherItemController overrides: 33 // LauncherItemController overrides:
31 virtual string16 GetTitle() OVERRIDE; 34 virtual string16 GetTitle() OVERRIDE;
32 virtual bool IsCurrentlyShownInWindow(aura::Window* window) const OVERRIDE; 35 virtual bool IsCurrentlyShownInWindow(aura::Window* window) const OVERRIDE;
33 virtual bool IsOpen() const OVERRIDE; 36 virtual bool IsOpen() const OVERRIDE;
34 virtual bool IsVisible() const OVERRIDE; 37 virtual bool IsVisible() const OVERRIDE;
35 virtual void Launch(int event_flags) OVERRIDE; 38 virtual void Launch(int event_flags) OVERRIDE;
36 virtual void Activate() OVERRIDE; 39 virtual void Activate() OVERRIDE;
37 virtual void Close() OVERRIDE; 40 virtual void Close() OVERRIDE;
38 virtual void Clicked(const ui::Event& event) OVERRIDE; 41 virtual void Clicked(const ui::Event& event) OVERRIDE;
39 virtual void OnRemoved() OVERRIDE; 42 virtual void OnRemoved() OVERRIDE;
40 virtual ChromeLauncherAppMenuItems GetApplicationList( 43 virtual ChromeLauncherAppMenuItems GetApplicationList(
41 int event_flags) OVERRIDE; 44 int event_flags) OVERRIDE;
42 45
43 private: 46 private:
44 // Get the favicon for the browser list entry for |web_contents|. 47 // Get the favicon for the browser list entry for |web_contents|.
45 // Note that for incognito windows the incognito icon will be returned. 48 // Note that for incognito windows the incognito icon will be returned.
46 gfx::Image GetBrowserListIcon(content::WebContents* web_contents) const; 49 gfx::Image GetBrowserListIcon(content::WebContents* web_contents) const;
47 50
48 // Get the title for the browser list entry for |web_contents|. 51 // Get the title for the browser list entry for |web_contents|.
49 // If |web_contents| has not loaded, returns "Net Tab". 52 // If |web_contents| has not loaded, returns "Net Tab".
50 string16 GetBrowserListTitle(content::WebContents* web_contents) const; 53 string16 GetBrowserListTitle(content::WebContents* web_contents) const;
51 54
52 // Check if the given |web_contents| is in incognito mode. 55 // Check if the given |web_contents| is in incognito mode.
53 bool IsIncognito(content::WebContents* web_contents) const; 56 bool IsIncognito(content::WebContents* web_contents) const;
54 57
55 // Activate a browser - or advance to the next one on the list. 58 // Activate a browser - or advance to the next one on the list.
56 void ActivateOrAdvanceToNextBrowser(); 59 void ActivateOrAdvanceToNextBrowser();
57 60
61 // Returns true when the given |browser| is listed in the browser application
62 // list.
63 bool IsBrowserRepresentedInBrowserList(Browser* browser);
64
58 Profile* profile_; 65 Profile* profile_;
59 66
60 DISALLOW_COPY_AND_ASSIGN(BrowserShortcutLauncherItemController); 67 DISALLOW_COPY_AND_ASSIGN(BrowserShortcutLauncherItemController);
61 }; 68 };
62 69
63 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_BROWSER_SHORTCUT_LAUNCHER_ITEM_CONTROL LER_H_ 70 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_BROWSER_SHORTCUT_LAUNCHER_ITEM_CONTROL LER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698