| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_TOOLBAR_BACK_FORWARD_MENU_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_BACK_FORWARD_MENU_MODEL_H_ |
| 6 #define CHROME_BROWSER_UI_TOOLBAR_BACK_FORWARD_MENU_MODEL_H_ | 6 #define CHROME_BROWSER_UI_TOOLBAR_BACK_FORWARD_MENU_MODEL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 14 #include "base/string16.h" | 14 #include "base/string16.h" |
| 15 #include "chrome/browser/favicon/favicon_service.h" | 15 #include "chrome/browser/favicon/favicon_service.h" |
| 16 #include "ui/base/models/menu_model.h" | 16 #include "ui/base/models/menu_model.h" |
| 17 #include "webkit/glue/window_open_disposition.h" | 17 #include "webkit/glue/window_open_disposition.h" |
| 18 | 18 |
| 19 class Browser; | 19 class Browser; |
| 20 class SkBitmap; | |
| 21 | 20 |
| 22 namespace content { | 21 namespace content { |
| 23 class NavigationEntry; | 22 class NavigationEntry; |
| 24 class WebContents; | 23 class WebContents; |
| 25 } | 24 } |
| 26 | 25 |
| 26 namespace gfx { |
| 27 class ImageSkia; |
| 28 } |
| 29 |
| 27 /////////////////////////////////////////////////////////////////////////////// | 30 /////////////////////////////////////////////////////////////////////////////// |
| 28 // | 31 // |
| 29 // BackForwardMenuModel | 32 // BackForwardMenuModel |
| 30 // | 33 // |
| 31 // Interface for the showing of the dropdown menu for the Back/Forward buttons. | 34 // Interface for the showing of the dropdown menu for the Back/Forward buttons. |
| 32 // Actual implementations are platform-specific. | 35 // Actual implementations are platform-specific. |
| 33 /////////////////////////////////////////////////////////////////////////////// | 36 /////////////////////////////////////////////////////////////////////////////// |
| 34 class BackForwardMenuModel : public ui::MenuModel { | 37 class BackForwardMenuModel : public ui::MenuModel { |
| 35 public: | 38 public: |
| 36 // These are IDs used to identify individual UI elements within the | 39 // These are IDs used to identify individual UI elements within the |
| (...skipping 14 matching lines...) Expand all Loading... |
| 51 // out the total number of items to show. | 54 // out the total number of items to show. |
| 52 virtual int GetItemCount() const OVERRIDE; | 55 virtual int GetItemCount() const OVERRIDE; |
| 53 virtual ItemType GetTypeAt(int index) const OVERRIDE; | 56 virtual ItemType GetTypeAt(int index) const OVERRIDE; |
| 54 virtual int GetCommandIdAt(int index) const OVERRIDE; | 57 virtual int GetCommandIdAt(int index) const OVERRIDE; |
| 55 virtual string16 GetLabelAt(int index) const OVERRIDE; | 58 virtual string16 GetLabelAt(int index) const OVERRIDE; |
| 56 virtual bool IsItemDynamicAt(int index) const OVERRIDE; | 59 virtual bool IsItemDynamicAt(int index) const OVERRIDE; |
| 57 virtual bool GetAcceleratorAt(int index, | 60 virtual bool GetAcceleratorAt(int index, |
| 58 ui::Accelerator* accelerator) const OVERRIDE; | 61 ui::Accelerator* accelerator) const OVERRIDE; |
| 59 virtual bool IsItemCheckedAt(int index) const OVERRIDE; | 62 virtual bool IsItemCheckedAt(int index) const OVERRIDE; |
| 60 virtual int GetGroupIdAt(int index) const OVERRIDE; | 63 virtual int GetGroupIdAt(int index) const OVERRIDE; |
| 61 virtual bool GetIconAt(int index, SkBitmap* icon) OVERRIDE; | 64 virtual bool GetIconAt(int index, gfx::ImageSkia* icon) OVERRIDE; |
| 62 virtual ui::ButtonMenuItemModel* GetButtonMenuItemAt( | 65 virtual ui::ButtonMenuItemModel* GetButtonMenuItemAt( |
| 63 int index) const OVERRIDE; | 66 int index) const OVERRIDE; |
| 64 virtual bool IsEnabledAt(int index) const OVERRIDE; | 67 virtual bool IsEnabledAt(int index) const OVERRIDE; |
| 65 virtual MenuModel* GetSubmenuModelAt(int index) const OVERRIDE; | 68 virtual MenuModel* GetSubmenuModelAt(int index) const OVERRIDE; |
| 66 virtual void HighlightChangedTo(int index) OVERRIDE; | 69 virtual void HighlightChangedTo(int index) OVERRIDE; |
| 67 virtual void ActivatedAt(int index) OVERRIDE; | 70 virtual void ActivatedAt(int index) OVERRIDE; |
| 68 virtual void ActivatedAt(int index, int event_flags) OVERRIDE; | 71 virtual void ActivatedAt(int index, int event_flags) OVERRIDE; |
| 69 virtual void MenuWillShow() OVERRIDE; | 72 virtual void MenuWillShow() OVERRIDE; |
| 70 | 73 |
| 71 // Is the item at |index| a separator? | 74 // Is the item at |index| a separator? |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 // Used for loading favicons from history. | 199 // Used for loading favicons from history. |
| 197 CancelableRequestConsumerTSimple<int> load_consumer_; | 200 CancelableRequestConsumerTSimple<int> load_consumer_; |
| 198 | 201 |
| 199 // Used for receiving notifications when an icon is changed. | 202 // Used for receiving notifications when an icon is changed. |
| 200 ui::MenuModelDelegate* menu_model_delegate_; | 203 ui::MenuModelDelegate* menu_model_delegate_; |
| 201 | 204 |
| 202 DISALLOW_COPY_AND_ASSIGN(BackForwardMenuModel); | 205 DISALLOW_COPY_AND_ASSIGN(BackForwardMenuModel); |
| 203 }; | 206 }; |
| 204 | 207 |
| 205 #endif // CHROME_BROWSER_UI_TOOLBAR_BACK_FORWARD_MENU_MODEL_H_ | 208 #endif // CHROME_BROWSER_UI_TOOLBAR_BACK_FORWARD_MENU_MODEL_H_ |
| OLD | NEW |