OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 |
11 class DictionaryValue; | 11 class DictionaryValue; |
12 class Profile; | 12 class Profile; |
13 class RenderViewHost; | 13 class RenderViewHost; |
14 class TabContents; | 14 class TabContents; |
15 | 15 |
16 namespace extension_sidebar_constants { | 16 namespace extension_sidebar_constants { |
17 extern const char kActiveState[]; | 17 extern const char kActiveState[]; |
18 extern const char kHiddenState[]; | 18 extern const char kHiddenState[]; |
19 extern const char kShownState[]; | 19 extern const char kShownState[]; |
20 } // namespace extension_sidebar_constants | 20 } // namespace extension_sidebar_constants |
21 | 21 |
22 // Event router class for events related to the sidebar API. | 22 // Event router class for events related to the sidebar API. |
23 class ExtensionSidebarEventRouter { | 23 class ExtensionSidebarEventRouter { |
24 public: | 24 public: |
25 // Sidebar state changed. | 25 // Sidebar state changed. |
26 static void OnStateChanged( | 26 static void OnStateChanged( |
27 Profile* profile, int tab_id, const std::string& content_id, | 27 Profile* profile, TabContents* tab, const std::string& content_id, |
28 const std::string& state); | 28 const std::string& state); |
29 | 29 |
30 private: | 30 private: |
31 DISALLOW_COPY_AND_ASSIGN(ExtensionSidebarEventRouter); | 31 DISALLOW_COPY_AND_ASSIGN(ExtensionSidebarEventRouter); |
32 }; | 32 }; |
33 | 33 |
34 // Base class for sidebar function APIs. | 34 // Base class for sidebar function APIs. |
35 class SidebarFunction : public SyncExtensionFunction { | 35 class SidebarFunction : public SyncExtensionFunction { |
36 public: | 36 public: |
37 virtual bool RunImpl(); | 37 virtual bool RunImpl(); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 class ShowSidebarFunction : public SidebarFunction { | 108 class ShowSidebarFunction : public SidebarFunction { |
109 private: | 109 private: |
110 virtual bool RunImpl(TabContents* tab, | 110 virtual bool RunImpl(TabContents* tab, |
111 const std::string& content_id, | 111 const std::string& content_id, |
112 const DictionaryValue& details); | 112 const DictionaryValue& details); |
113 DECLARE_EXTENSION_FUNCTION_NAME("experimental.sidebar.show"); | 113 DECLARE_EXTENSION_FUNCTION_NAME("experimental.sidebar.show"); |
114 }; | 114 }; |
115 | 115 |
116 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SIDEBAR_API_H_ | 116 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SIDEBAR_API_H_ |
117 | 117 |
OLD | NEW |