Home | History | Annotate | Download | only in launcher
      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
      3 // found in the LICENSE file.
      4 
      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_
      7 
      8 #include "base/values.h"
      9 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h"
     10 #include "content/public/browser/notification_observer.h"
     11 #include "content/public/browser/notification_registrar.h"
     12 
     13 class Browser;
     14 
     15 // A menu item controller for a running browser. It gets created when an
     16 // application list gets created. It's main purpose is to add the activation
     17 // method to the |ChromeLauncherAppMenuItem| class.
     18 class ChromeLauncherAppMenuItemBrowser : public content::NotificationObserver,
     19                                          public ChromeLauncherAppMenuItem {
     20  public:
     21   ChromeLauncherAppMenuItemBrowser(const string16 title,
     22                                    const gfx::Image* icon,
     23                                    Browser* browser,
     24                                    bool has_leading_separator);
     25   virtual bool IsActive() const OVERRIDE;
     26   virtual bool IsEnabled() const OVERRIDE;
     27   virtual void Execute(int event_flags) OVERRIDE;
     28 
     29  private:
     30   // content::NotificationObserver.
     31   virtual void Observe(int type,
     32                        const content::NotificationSource& source,
     33                        const content::NotificationDetails& details) OVERRIDE;
     34 
     35   // The browser which is associated which this item.
     36   Browser* browser_;
     37 
     38   content::NotificationRegistrar registrar_;
     39 
     40   DISALLOW_COPY_AND_ASSIGN(ChromeLauncherAppMenuItemBrowser);
     41 };
     42 
     43 #endif  // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_APP_MENU_ITEM_BROWSER_H_
     44