OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_GTK_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_GTK_H_ |
6 #define CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_GTK_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_GTK_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 23 matching lines...) Expand all Loading... |
34 virtual bool IsCommandEnabled(int id) const; | 34 virtual bool IsCommandEnabled(int id) const; |
35 virtual bool IsItemChecked(int id) const; | 35 virtual bool IsItemChecked(int id) const; |
36 virtual void ExecuteCommand(int id); | 36 virtual void ExecuteCommand(int id); |
37 virtual std::string GetLabel(int id) const; | 37 virtual std::string GetLabel(int id) const; |
38 virtual void StoppedShowing(); | 38 virtual void StoppedShowing(); |
39 | 39 |
40 protected: | 40 protected: |
41 // RenderViewContextMenu implementation -------------------------------------- | 41 // RenderViewContextMenu implementation -------------------------------------- |
42 virtual void DoInit(); | 42 virtual void DoInit(); |
43 virtual void AppendMenuItem(int id); | 43 virtual void AppendMenuItem(int id); |
44 virtual void AppendMenuItem(int id, const std::wstring& label); | 44 virtual void AppendMenuItem(int id, const string16& label); |
45 virtual void AppendRadioMenuItem(int id, const std::wstring& label); | 45 virtual void AppendRadioMenuItem(int id, const string16& label); |
46 virtual void AppendCheckboxMenuItem(int id, const std::wstring& label); | 46 virtual void AppendCheckboxMenuItem(int id, const string16& label); |
47 virtual void AppendSeparator(); | 47 virtual void AppendSeparator(); |
48 virtual void StartSubMenu(int id, const std::wstring& label); | 48 virtual void StartSubMenu(int id, const string16& label); |
49 virtual void FinishSubMenu(); | 49 virtual void FinishSubMenu(); |
50 virtual void DidWriteURLToClipboard(const std::string& url); | 50 virtual void DidWriteURLToClipboard(const std::string& url); |
51 | 51 |
52 private: | 52 private: |
53 void AppendItem(int id, const std::wstring& label, MenuItemType type); | 53 void AppendItem(int id, const string16& label, MenuItemType type); |
54 static void DoneMakingMenu(std::vector<MenuCreateMaterial>* menu); | 54 static void DoneMakingMenu(std::vector<MenuCreateMaterial>* menu); |
55 | 55 |
56 scoped_ptr<MenuGtk> gtk_menu_; | 56 scoped_ptr<MenuGtk> gtk_menu_; |
57 std::map<int, std::string> label_map_; | 57 std::map<int, std::string> label_map_; |
58 std::vector<MenuCreateMaterial> menu_; | 58 std::vector<MenuCreateMaterial> menu_; |
59 std::vector<MenuCreateMaterial> submenu_; | 59 std::vector<MenuCreateMaterial> submenu_; |
60 bool making_submenu_; | 60 bool making_submenu_; |
61 uint32_t triggering_event_time_; | 61 uint32_t triggering_event_time_; |
62 }; | 62 }; |
63 | 63 |
64 #endif // CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_GTK_H_ | 64 #endif // CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_GTK_H_ |
OLD | NEW |