Home | History | Annotate | Download | only in notifications
      1 // Copyright (c) 2010 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_NOTIFICATIONS_NOTIFICATION_OPTIONS_MENU_MODEL_H_
      6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OPTIONS_MENU_MODEL_H_
      7 #pragma once
      8 
      9 #include "chrome/browser/notifications/balloon.h"
     10 #include "ui/base/models/simple_menu_model.h"
     11 
     12 // Model for the corner-selection submenu.
     13 class CornerSelectionMenuModel : public ui::SimpleMenuModel,
     14                                  public ui::SimpleMenuModel::Delegate {
     15  public:
     16   explicit CornerSelectionMenuModel(Balloon* balloon);
     17   virtual ~CornerSelectionMenuModel();
     18 
     19   // Overridden from ui::SimpleMenuModel::Delegate:
     20   virtual bool IsCommandIdChecked(int command_id) const;
     21   virtual bool IsCommandIdEnabled(int command_id) const;
     22   virtual bool GetAcceleratorForCommandId(int command_id,
     23                                           ui::Accelerator* accelerator);
     24   virtual void ExecuteCommand(int command_id);
     25 
     26  private:
     27   // Not owned.
     28   Balloon* balloon_;
     29 
     30   DISALLOW_COPY_AND_ASSIGN(CornerSelectionMenuModel);
     31 };
     32 
     33 // Model for the notification options menu itself.
     34 class NotificationOptionsMenuModel : public ui::SimpleMenuModel,
     35                                      public ui::SimpleMenuModel::Delegate {
     36  public:
     37   explicit NotificationOptionsMenuModel(Balloon* balloon);
     38   virtual ~NotificationOptionsMenuModel();
     39 
     40   // Overridden from ui::SimpleMenuModel:
     41   virtual bool IsItemForCommandIdDynamic(int command_id) const;
     42   virtual string16 GetLabelForCommandId(int command_id) const;
     43 
     44   // Overridden from ui::SimpleMenuModel::Delegate:
     45   virtual bool IsCommandIdChecked(int command_id) const;
     46   virtual bool IsCommandIdEnabled(int command_id) const;
     47   virtual bool GetAcceleratorForCommandId(int command_id,
     48                                           ui::Accelerator* accelerator);
     49   virtual void ExecuteCommand(int command_id);
     50 
     51  private:
     52   Balloon* balloon_; // Not owned.
     53 
     54   scoped_ptr<CornerSelectionMenuModel> corner_menu_model_;
     55 
     56   DISALLOW_COPY_AND_ASSIGN(NotificationOptionsMenuModel);
     57 };
     58 
     59 #endif  // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OPTIONS_MENU_MODEL_H_
     60