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_CHROMEOS_STATUS_NETWORK_MENU_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_H_ |
6 #define CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_H_ | 6 #define CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 10 matching lines...) Expand all Loading... |
21 const int kMoreCommandIndexOffset = 3000; | 21 const int kMoreCommandIndexOffset = 3000; |
22 | 22 |
23 } // namespace | 23 } // namespace |
24 | 24 |
25 class SkBitmap; | 25 class SkBitmap; |
26 | 26 |
27 namespace gfx { | 27 namespace gfx { |
28 class Canvas; | 28 class Canvas; |
29 } | 29 } |
30 | 30 |
| 31 namespace ui { |
| 32 class MenuModel; |
| 33 } |
| 34 |
31 namespace views { | 35 namespace views { |
32 class MenuItemView; | 36 class MenuItemView; |
33 class MenuButton; | 37 class MenuButton; |
| 38 class MenuModelAdapter; |
34 } | 39 } |
35 | 40 |
36 namespace chromeos { | 41 namespace chromeos { |
37 | 42 |
38 class NetworkMenuModel; | 43 class NetworkMenuModel; |
39 | 44 |
40 // Menu for network menu button in the status area/welcome screen. | 45 // Menu for network menu button in the status area/welcome screen. |
41 // This class will populating the menu with the list of networks. | 46 // This class will populating the menu with the list of networks. |
42 // It will also handle connecting to another wifi/cellular network. | 47 // It will also handle connecting to another wifi/cellular network. |
43 // | 48 // |
(...skipping 30 matching lines...) Expand all Loading... |
74 public: | 79 public: |
75 virtual views::MenuButton* GetMenuButton() = 0; | 80 virtual views::MenuButton* GetMenuButton() = 0; |
76 virtual gfx::NativeWindow GetNativeWindow() const = 0; | 81 virtual gfx::NativeWindow GetNativeWindow() const = 0; |
77 virtual void OpenButtonOptions() = 0; | 82 virtual void OpenButtonOptions() = 0; |
78 virtual bool ShouldOpenButtonOptions() const = 0; | 83 virtual bool ShouldOpenButtonOptions() const = 0; |
79 }; | 84 }; |
80 | 85 |
81 NetworkMenu(Delegate* delegate, bool is_browser_mode); | 86 NetworkMenu(Delegate* delegate, bool is_browser_mode); |
82 virtual ~NetworkMenu(); | 87 virtual ~NetworkMenu(); |
83 | 88 |
| 89 // Access to menu definition. |
| 90 ui::MenuModel* GetMenuModel(); |
| 91 |
84 // Cancels the active menu. | 92 // Cancels the active menu. |
85 void CancelMenu(); | 93 void CancelMenu(); |
86 | 94 |
87 // Update the menu (e.g. when the network list or status has changed). | 95 // Update the menu (e.g. when the network list or status has changed). |
88 void UpdateMenu(); | 96 void UpdateMenu(); |
89 | 97 |
90 // Run the menu. | 98 // Run the menu. |
91 void RunMenu(views::View* source); | 99 void RunMenu(views::View* source); |
92 | 100 |
93 // Shows network details in Web UI options window. | 101 // Shows network details in Web UI options window. |
(...skipping 12 matching lines...) Expand all Loading... |
106 // Weak ptr to delegate. | 114 // Weak ptr to delegate. |
107 Delegate* delegate_; | 115 Delegate* delegate_; |
108 | 116 |
109 // True if the browser is visible (i.e. not login/OOBE). | 117 // True if the browser is visible (i.e. not login/OOBE). |
110 bool is_browser_mode_; | 118 bool is_browser_mode_; |
111 | 119 |
112 // Set to true if we are currently refreshing the menu. | 120 // Set to true if we are currently refreshing the menu. |
113 bool refreshing_menu_; | 121 bool refreshing_menu_; |
114 | 122 |
115 // The network menu. | 123 // The network menu. |
| 124 scoped_ptr<NetworkMenuModel> main_menu_model_; |
| 125 scoped_ptr<views::MenuModelAdapter> menu_model_adapter_; |
116 scoped_ptr<views::MenuItemView> menu_item_view_; | 126 scoped_ptr<views::MenuItemView> menu_item_view_; |
117 scoped_ptr<NetworkMenuModel> main_menu_model_; | |
118 | 127 |
119 // Holds minimum width of the menu. | 128 // Holds minimum width of the menu. |
120 int min_width_; | 129 int min_width_; |
121 | 130 |
122 DISALLOW_COPY_AND_ASSIGN(NetworkMenu); | 131 DISALLOW_COPY_AND_ASSIGN(NetworkMenu); |
123 }; | 132 }; |
124 | 133 |
125 } // namespace chromeos | 134 } // namespace chromeos |
126 | 135 |
127 #endif // CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_H_ | 136 #endif // CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_H_ |
OLD | NEW |