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

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

Issue 2671923002: mash: Cleanup ash shelf application menu code. (Closed)
Patch Set: Add comments 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) 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_APP_MENU_ITEM_BROWSER_H_ 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_APP_MENU_ITEM_BROWSER_H_
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_APP_MENU_ITEM_BROWSER_H_ 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_APP_MENU_ITEM_BROWSER_H_
7 7
8 #include "ash/public/cpp/shelf_application_menu_item.h"
8 #include "base/macros.h" 9 #include "base/macros.h"
9 #include "base/values.h"
10 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h"
11 #include "content/public/browser/notification_observer.h" 10 #include "content/public/browser/notification_observer.h"
12 #include "content/public/browser/notification_registrar.h" 11 #include "content/public/browser/notification_registrar.h"
13 12
14 class Browser; 13 class Browser;
15 14
16 // A menu item controller for a running browser. It gets created when an 15 // A shelf application menu item for a running browser.
17 // application list gets created. It's main purpose is to add the activation 16 class ChromeLauncherAppMenuItemBrowser : public ash::ShelfApplicationMenuItem,
18 // method to the |ChromeLauncherAppMenuItem| class. 17 public content::NotificationObserver {
19 class ChromeLauncherAppMenuItemBrowser : public content::NotificationObserver,
20 public ChromeLauncherAppMenuItem {
21 public: 18 public:
22 ChromeLauncherAppMenuItemBrowser(const base::string16 title, 19 ChromeLauncherAppMenuItemBrowser(const base::string16 title,
23 const gfx::Image* icon, 20 const gfx::Image* icon,
24 Browser* browser, 21 Browser* browser);
25 bool has_leading_separator);
26 ~ChromeLauncherAppMenuItemBrowser() override; 22 ~ChromeLauncherAppMenuItemBrowser() override;
27 23
28 bool IsEnabled() const override; 24 // ash::ShelfApplicationMenuItem:
29 void Execute(int event_flags) override; 25 void Execute(int event_flags) override;
30 26
31 private: 27 private:
32 // content::NotificationObserver. 28 // content::NotificationObserver.
33 void Observe(int type, 29 void Observe(int type,
34 const content::NotificationSource& source, 30 const content::NotificationSource& source,
35 const content::NotificationDetails& details) override; 31 const content::NotificationDetails& details) override;
36 32
37 // The browser which is associated which this item. 33 // The browser which is associated which this item.
38 Browser* browser_; 34 Browser* browser_;
39 35
40 content::NotificationRegistrar registrar_; 36 content::NotificationRegistrar registrar_;
41 37
42 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherAppMenuItemBrowser); 38 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherAppMenuItemBrowser);
43 }; 39 };
44 40
45 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_APP_MENU_ITEM_BROWSER_ H_ 41 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_APP_MENU_ITEM_BROWSER_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698