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_EXTENSIONS_EXTENSION_SIDEBAR_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SIDEBAR_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SIDEBAR_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SIDEBAR_API_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include "chrome/browser/extensions/extension_function.h" | 9 #include "chrome/browser/extensions/extension_function.h" |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 Profile* profile, TabContents* tab, const std::string& content_id, | 29 Profile* profile, TabContents* tab, const std::string& content_id, |
30 const std::string& state); | 30 const std::string& state); |
31 | 31 |
32 private: | 32 private: |
33 DISALLOW_COPY_AND_ASSIGN(ExtensionSidebarEventRouter); | 33 DISALLOW_COPY_AND_ASSIGN(ExtensionSidebarEventRouter); |
34 }; | 34 }; |
35 | 35 |
36 // Base class for sidebar function APIs. | 36 // Base class for sidebar function APIs. |
37 class SidebarFunction : public SyncExtensionFunction { | 37 class SidebarFunction : public SyncExtensionFunction { |
38 public: | 38 public: |
39 virtual bool RunImpl(); | 39 virtual bool RunImpl() OVERRIDE; |
40 private: | 40 private: |
41 virtual bool RunImpl(TabContents* tab, | 41 virtual bool RunImpl(TabContents* tab, |
42 const std::string& content_id, | 42 const std::string& content_id, |
43 const base::DictionaryValue& details) = 0; | 43 const base::DictionaryValue& details) = 0; |
44 }; | 44 }; |
45 | 45 |
46 class CollapseSidebarFunction : public SidebarFunction { | 46 class CollapseSidebarFunction : public SidebarFunction { |
47 private: | 47 private: |
48 virtual bool RunImpl(TabContents* tab, | 48 virtual bool RunImpl(TabContents* tab, |
49 const std::string& content_id, | 49 const std::string& content_id, |
50 const base::DictionaryValue& details); | 50 const base::DictionaryValue& details) OVERRIDE; |
51 DECLARE_EXTENSION_FUNCTION_NAME("experimental.sidebar.collapse"); | 51 DECLARE_EXTENSION_FUNCTION_NAME("experimental.sidebar.collapse"); |
52 }; | 52 }; |
53 | 53 |
54 class ExpandSidebarFunction : public SidebarFunction { | 54 class ExpandSidebarFunction : public SidebarFunction { |
55 private: | 55 private: |
56 virtual bool RunImpl(TabContents* tab, | 56 virtual bool RunImpl(TabContents* tab, |
57 const std::string& content_id, | 57 const std::string& content_id, |
58 const base::DictionaryValue& details); | 58 const base::DictionaryValue& details) OVERRIDE; |
59 DECLARE_EXTENSION_FUNCTION_NAME("experimental.sidebar.expand"); | 59 DECLARE_EXTENSION_FUNCTION_NAME("experimental.sidebar.expand"); |
60 }; | 60 }; |
61 | 61 |
62 class GetStateSidebarFunction : public SidebarFunction { | 62 class GetStateSidebarFunction : public SidebarFunction { |
63 private: | 63 private: |
64 virtual bool RunImpl(TabContents* tab, | 64 virtual bool RunImpl(TabContents* tab, |
65 const std::string& content_id, | 65 const std::string& content_id, |
66 const base::DictionaryValue& details); | 66 const base::DictionaryValue& details) OVERRIDE; |
67 DECLARE_EXTENSION_FUNCTION_NAME("experimental.sidebar.getState"); | 67 DECLARE_EXTENSION_FUNCTION_NAME("experimental.sidebar.getState"); |
68 }; | 68 }; |
69 | 69 |
70 class HideSidebarFunction : public SidebarFunction { | 70 class HideSidebarFunction : public SidebarFunction { |
71 private: | 71 private: |
72 virtual bool RunImpl(TabContents* tab, | 72 virtual bool RunImpl(TabContents* tab, |
73 const std::string& content_id, | 73 const std::string& content_id, |
74 const base::DictionaryValue& details); | 74 const base::DictionaryValue& details) OVERRIDE; |
75 DECLARE_EXTENSION_FUNCTION_NAME("experimental.sidebar.hide"); | 75 DECLARE_EXTENSION_FUNCTION_NAME("experimental.sidebar.hide"); |
76 }; | 76 }; |
77 | 77 |
78 class NavigateSidebarFunction : public SidebarFunction { | 78 class NavigateSidebarFunction : public SidebarFunction { |
79 private: | 79 private: |
80 virtual bool RunImpl(TabContents* tab, | 80 virtual bool RunImpl(TabContents* tab, |
81 const std::string& content_id, | 81 const std::string& content_id, |
82 const base::DictionaryValue& details); | 82 const base::DictionaryValue& details) OVERRIDE; |
83 DECLARE_EXTENSION_FUNCTION_NAME("experimental.sidebar.navigate"); | 83 DECLARE_EXTENSION_FUNCTION_NAME("experimental.sidebar.navigate"); |
84 }; | 84 }; |
85 | 85 |
86 class SetBadgeTextSidebarFunction : public SidebarFunction { | 86 class SetBadgeTextSidebarFunction : public SidebarFunction { |
87 private: | 87 private: |
88 virtual bool RunImpl(TabContents* tab, | 88 virtual bool RunImpl(TabContents* tab, |
89 const std::string& content_id, | 89 const std::string& content_id, |
90 const base::DictionaryValue& details); | 90 const base::DictionaryValue& details) OVERRIDE; |
91 DECLARE_EXTENSION_FUNCTION_NAME("experimental.sidebar.setBadgeText"); | 91 DECLARE_EXTENSION_FUNCTION_NAME("experimental.sidebar.setBadgeText"); |
92 }; | 92 }; |
93 | 93 |
94 class SetIconSidebarFunction : public SidebarFunction { | 94 class SetIconSidebarFunction : public SidebarFunction { |
95 private: | 95 private: |
96 virtual bool RunImpl(TabContents* tab, | 96 virtual bool RunImpl(TabContents* tab, |
97 const std::string& content_id, | 97 const std::string& content_id, |
98 const base::DictionaryValue& details); | 98 const base::DictionaryValue& details) OVERRIDE; |
99 DECLARE_EXTENSION_FUNCTION_NAME("experimental.sidebar.setIcon"); | 99 DECLARE_EXTENSION_FUNCTION_NAME("experimental.sidebar.setIcon"); |
100 }; | 100 }; |
101 | 101 |
102 class SetTitleSidebarFunction : public SidebarFunction { | 102 class SetTitleSidebarFunction : public SidebarFunction { |
103 private: | 103 private: |
104 virtual bool RunImpl(TabContents* tab, | 104 virtual bool RunImpl(TabContents* tab, |
105 const std::string& content_id, | 105 const std::string& content_id, |
106 const base::DictionaryValue& details); | 106 const base::DictionaryValue& details) OVERRIDE; |
107 DECLARE_EXTENSION_FUNCTION_NAME("experimental.sidebar.setTitle"); | 107 DECLARE_EXTENSION_FUNCTION_NAME("experimental.sidebar.setTitle"); |
108 }; | 108 }; |
109 | 109 |
110 class ShowSidebarFunction : public SidebarFunction { | 110 class ShowSidebarFunction : public SidebarFunction { |
111 private: | 111 private: |
112 virtual bool RunImpl(TabContents* tab, | 112 virtual bool RunImpl(TabContents* tab, |
113 const std::string& content_id, | 113 const std::string& content_id, |
114 const base::DictionaryValue& details); | 114 const base::DictionaryValue& details) OVERRIDE; |
115 DECLARE_EXTENSION_FUNCTION_NAME("experimental.sidebar.show"); | 115 DECLARE_EXTENSION_FUNCTION_NAME("experimental.sidebar.show"); |
116 }; | 116 }; |
117 | 117 |
118 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SIDEBAR_API_H_ | 118 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SIDEBAR_API_H_ |
OLD | NEW |