Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(371)

Side by Side Diff: chrome/browser/extensions/extension_tabs_module.h

Issue 274059: Small cleanup to extension function registration to avoid scattered definitions. (Closed)
Patch Set: Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_EXTENSIONS_EXTENSION_TABS_MODULE_H__ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "chrome/browser/extensions/extension_function.h" 10 #include "chrome/browser/extensions/extension_function.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // be NULL and will not be set within the function. 45 // be NULL and will not be set within the function.
46 static bool GetTabById(int tab_id, Profile* profile, Browser** browser, 46 static bool GetTabById(int tab_id, Profile* profile, Browser** browser,
47 TabStripModel** tab_strip, 47 TabStripModel** tab_strip,
48 TabContents** contents, 48 TabContents** contents,
49 int* tab_index); 49 int* tab_index);
50 }; 50 };
51 51
52 // Windows 52 // Windows
53 class GetWindowFunction : public SyncExtensionFunction { 53 class GetWindowFunction : public SyncExtensionFunction {
54 virtual bool RunImpl(); 54 virtual bool RunImpl();
55 DECLARE_EXTENSION_FUNCTION_NAME("windows.get")
55 }; 56 };
56 class GetCurrentWindowFunction : public SyncExtensionFunction { 57 class GetCurrentWindowFunction : public SyncExtensionFunction {
57 virtual bool RunImpl(); 58 virtual bool RunImpl();
59 DECLARE_EXTENSION_FUNCTION_NAME("windows.getCurrent")
58 }; 60 };
59 class GetLastFocusedWindowFunction : public SyncExtensionFunction { 61 class GetLastFocusedWindowFunction : public SyncExtensionFunction {
60 virtual bool RunImpl(); 62 virtual bool RunImpl();
63 DECLARE_EXTENSION_FUNCTION_NAME("windows.getLastFocused")
61 }; 64 };
62 class GetAllWindowsFunction : public SyncExtensionFunction { 65 class GetAllWindowsFunction : public SyncExtensionFunction {
63 virtual bool RunImpl(); 66 virtual bool RunImpl();
67 DECLARE_EXTENSION_FUNCTION_NAME("windows.getAll")
64 }; 68 };
65 class CreateWindowFunction : public SyncExtensionFunction { 69 class CreateWindowFunction : public SyncExtensionFunction {
66 virtual bool RunImpl(); 70 virtual bool RunImpl();
71 DECLARE_EXTENSION_FUNCTION_NAME("windows.create")
67 }; 72 };
68 class UpdateWindowFunction : public SyncExtensionFunction { 73 class UpdateWindowFunction : public SyncExtensionFunction {
69 virtual bool RunImpl(); 74 virtual bool RunImpl();
75 DECLARE_EXTENSION_FUNCTION_NAME("windows.update")
70 }; 76 };
71 class RemoveWindowFunction : public SyncExtensionFunction { 77 class RemoveWindowFunction : public SyncExtensionFunction {
72 virtual bool RunImpl(); 78 virtual bool RunImpl();
79 DECLARE_EXTENSION_FUNCTION_NAME("windows.remove")
73 }; 80 };
74 81
75 // Tabs 82 // Tabs
76 class GetTabFunction : public SyncExtensionFunction { 83 class GetTabFunction : public SyncExtensionFunction {
77 virtual bool RunImpl(); 84 virtual bool RunImpl();
85 DECLARE_EXTENSION_FUNCTION_NAME("tabs.get")
78 }; 86 };
79 class GetSelectedTabFunction : public SyncExtensionFunction { 87 class GetSelectedTabFunction : public SyncExtensionFunction {
80 virtual bool RunImpl(); 88 virtual bool RunImpl();
89 DECLARE_EXTENSION_FUNCTION_NAME("tabs.getSelected")
81 }; 90 };
82 class GetAllTabsInWindowFunction : public SyncExtensionFunction { 91 class GetAllTabsInWindowFunction : public SyncExtensionFunction {
83 virtual bool RunImpl(); 92 virtual bool RunImpl();
93 DECLARE_EXTENSION_FUNCTION_NAME("tabs.getAllInWindow")
84 }; 94 };
85 class CreateTabFunction : public SyncExtensionFunction { 95 class CreateTabFunction : public SyncExtensionFunction {
86 virtual bool RunImpl(); 96 virtual bool RunImpl();
97 DECLARE_EXTENSION_FUNCTION_NAME("tabs.create")
87 }; 98 };
88 class UpdateTabFunction : public SyncExtensionFunction { 99 class UpdateTabFunction : public SyncExtensionFunction {
89 virtual bool RunImpl(); 100 virtual bool RunImpl();
101 DECLARE_EXTENSION_FUNCTION_NAME("tabs.update")
90 }; 102 };
91 class MoveTabFunction : public SyncExtensionFunction { 103 class MoveTabFunction : public SyncExtensionFunction {
92 virtual bool RunImpl(); 104 virtual bool RunImpl();
105 DECLARE_EXTENSION_FUNCTION_NAME("tabs.move")
93 }; 106 };
94 class RemoveTabFunction : public SyncExtensionFunction { 107 class RemoveTabFunction : public SyncExtensionFunction {
95 virtual bool RunImpl(); 108 virtual bool RunImpl();
109 DECLARE_EXTENSION_FUNCTION_NAME("tabs.remove")
96 }; 110 };
97 class DetectTabLanguageFunction : public AsyncExtensionFunction, 111 class DetectTabLanguageFunction : public AsyncExtensionFunction,
98 public NotificationObserver { 112 public NotificationObserver {
99 private: 113 private:
100 virtual bool RunImpl(); 114 virtual bool RunImpl();
101 115
102 virtual void Observe(NotificationType type, 116 virtual void Observe(NotificationType type,
103 const NotificationSource& source, 117 const NotificationSource& source,
104 const NotificationDetails& details); 118 const NotificationDetails& details);
105 NotificationRegistrar registrar_; 119 NotificationRegistrar registrar_;
120 DECLARE_EXTENSION_FUNCTION_NAME("tabs.detectLanguage")
106 }; 121 };
107 class CaptureVisibleTabFunction : public SyncExtensionFunction { 122 class CaptureVisibleTabFunction : public SyncExtensionFunction {
108 virtual bool RunImpl(); 123 virtual bool RunImpl();
124 DECLARE_EXTENSION_FUNCTION_NAME("tabs.captureVisibleTab")
109 }; 125 };
110 126
111 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__ 127 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698