Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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_SEARCH_OTHER_DEVICE_MENU_H_ | |
| 6 #define CHROME_BROWSER_UI_SEARCH_OTHER_DEVICE_MENU_H_ | |
| 7 | |
| 8 #include "base/memory/linked_ptr.h" | |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "base/values.h" | |
| 11 #include "ui/base/models/simple_menu_model.h" | |
| 12 | |
| 13 namespace content { | |
| 14 class WebUI; | |
| 15 } | |
| 16 | |
| 17 namespace gfx { | |
| 18 class Point; | |
| 19 } | |
| 20 | |
| 21 namespace views { | |
| 22 class MenuRunner; | |
| 23 } | |
| 24 | |
| 25 typedef std::map<int, linked_ptr<DictionaryValue> > SessionData; | |
|
dhollowa
2012/10/01 17:37:38
A comment here would be nice. What does the |int|
dhollowa
2012/10/01 17:37:38
This should be pulled inside the class - possibly
jeremycho
2012/10/01 22:53:40
Done.
jeremycho
2012/10/01 22:53:40
Done.
| |
| 26 | |
| 27 class OtherDeviceMenu : public ui::SimpleMenuModel::Delegate { | |
|
dhollowa
2012/10/01 17:37:38
Seems like |OtherDevicesMenu| would be more approp
dhollowa
2012/10/01 17:37:38
A brief comment for the class would be helpful. W
jeremycho
2012/10/01 22:53:40
This menu will only hold the session of a single d
jeremycho
2012/10/01 22:53:40
Done.
| |
| 28 | |
| 29 public: | |
| 30 OtherDeviceMenu(content::WebUI* web_ui, | |
| 31 const std::string& session_id, | |
| 32 const gfx::Point& location); | |
| 33 virtual ~OtherDeviceMenu(); | |
| 34 | |
| 35 // Populates and displays the menu. | |
| 36 void ShowMenu(); | |
| 37 | |
| 38 // ui::SimpleMenuModel::Delegate overrides: | |
| 39 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | |
| 40 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; | |
| 41 virtual void ExecuteCommand(int command_id) OVERRIDE; | |
| 42 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; | |
| 43 virtual bool GetAcceleratorForCommandId( | |
| 44 int command_id, | |
| 45 ui::Accelerator* accelerator) OVERRIDE; | |
| 46 | |
| 47 private: | |
| 48 content::WebUI* web_ui_; | |
|
dhollowa
2012/10/01 17:37:38
Comment please, indicating ownership, such as "Wea
jeremycho
2012/10/01 22:53:40
Done.
| |
| 49 const std::string& session_id_; | |
| 50 const gfx::Point& location_; | |
|
dhollowa
2012/10/01 17:37:38
Comment please. Origin of top-left of menu, or wh
jeremycho
2012/10/01 22:53:40
Done.
| |
| 51 ui::SimpleMenuModel menu_model_; | |
| 52 scoped_ptr<views::MenuRunner> menu_runner_; | |
| 53 // Mapping of command_id to data for the associated tab of this session. | |
| 54 SessionData session_data_; | |
| 55 | |
| 56 DISALLOW_COPY_AND_ASSIGN(OtherDeviceMenu); | |
| 57 }; | |
| 58 | |
| 59 #endif // CHROME_BROWSER_UI_SEARCH_OTHER_DEVICE_MENU_H_ | |
| OLD | NEW |