| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |