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

Side by Side Diff: chrome/browser/extensions/api/tabs/tabs_api.h

Issue 257333002: Drive extension functions from ExtensionFunction::Run. The (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comment Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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_API_TABS_TABS_API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 protected: 141 protected:
142 virtual ~TabsUpdateFunction() {} 142 virtual ~TabsUpdateFunction() {}
143 virtual bool UpdateURL(const std::string& url, 143 virtual bool UpdateURL(const std::string& url,
144 int tab_id, 144 int tab_id,
145 bool* is_async); 145 bool* is_async);
146 virtual void PopulateResult(); 146 virtual void PopulateResult();
147 147
148 content::WebContents* web_contents_; 148 content::WebContents* web_contents_;
149 149
150 private: 150 private:
151 virtual bool RunImpl() OVERRIDE; 151 virtual bool RunAsync() OVERRIDE;
152 void OnExecuteCodeFinished(const std::string& error, 152 void OnExecuteCodeFinished(const std::string& error,
153 int32 on_page_id, 153 int32 on_page_id,
154 const GURL& on_url, 154 const GURL& on_url,
155 const base::ListValue& script_result); 155 const base::ListValue& script_result);
156 156
157 DECLARE_EXTENSION_FUNCTION("tabs.update", TABS_UPDATE) 157 DECLARE_EXTENSION_FUNCTION("tabs.update", TABS_UPDATE)
158 }; 158 };
159 class TabsMoveFunction : public ChromeSyncExtensionFunction { 159 class TabsMoveFunction : public ChromeSyncExtensionFunction {
160 virtual ~TabsMoveFunction() {} 160 virtual ~TabsMoveFunction() {}
161 virtual bool RunSync() OVERRIDE; 161 virtual bool RunSync() OVERRIDE;
(...skipping 12 matching lines...) Expand all
174 class TabsRemoveFunction : public ChromeSyncExtensionFunction { 174 class TabsRemoveFunction : public ChromeSyncExtensionFunction {
175 virtual ~TabsRemoveFunction() {} 175 virtual ~TabsRemoveFunction() {}
176 virtual bool RunSync() OVERRIDE; 176 virtual bool RunSync() OVERRIDE;
177 bool RemoveTab(int tab_id); 177 bool RemoveTab(int tab_id);
178 DECLARE_EXTENSION_FUNCTION("tabs.remove", TABS_REMOVE) 178 DECLARE_EXTENSION_FUNCTION("tabs.remove", TABS_REMOVE)
179 }; 179 };
180 class TabsDetectLanguageFunction : public ChromeAsyncExtensionFunction, 180 class TabsDetectLanguageFunction : public ChromeAsyncExtensionFunction,
181 public content::NotificationObserver { 181 public content::NotificationObserver {
182 private: 182 private:
183 virtual ~TabsDetectLanguageFunction() {} 183 virtual ~TabsDetectLanguageFunction() {}
184 virtual bool RunImpl() OVERRIDE; 184 virtual bool RunAsync() OVERRIDE;
185 185
186 virtual void Observe(int type, 186 virtual void Observe(int type,
187 const content::NotificationSource& source, 187 const content::NotificationSource& source,
188 const content::NotificationDetails& details) OVERRIDE; 188 const content::NotificationDetails& details) OVERRIDE;
189 void GotLanguage(const std::string& language); 189 void GotLanguage(const std::string& language);
190 content::NotificationRegistrar registrar_; 190 content::NotificationRegistrar registrar_;
191 DECLARE_EXTENSION_FUNCTION("tabs.detectLanguage", TABS_DETECTLANGUAGE) 191 DECLARE_EXTENSION_FUNCTION("tabs.detectLanguage", TABS_DETECTLANGUAGE)
192 }; 192 };
193 class TabsCaptureVisibleTabFunction 193 class TabsCaptureVisibleTabFunction
194 : public extensions::CaptureWebContentsFunction { 194 : public extensions::CaptureWebContentsFunction {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 virtual ~TabsInsertCSSFunction() {} 252 virtual ~TabsInsertCSSFunction() {}
253 253
254 virtual bool ShouldInsertCSS() const OVERRIDE; 254 virtual bool ShouldInsertCSS() const OVERRIDE;
255 255
256 DECLARE_EXTENSION_FUNCTION("tabs.insertCSS", TABS_INSERTCSS) 256 DECLARE_EXTENSION_FUNCTION("tabs.insertCSS", TABS_INSERTCSS)
257 }; 257 };
258 258
259 } // namespace extensions 259 } // namespace extensions
260 260
261 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_ 261 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/system_storage/system_storage_api.cc ('k') | chrome/browser/extensions/api/tabs/tabs_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698