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

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

Issue 301733006: Zoom Extension API (chrome) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix javascript test function signature. Created 6 years, 5 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
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "chrome/browser/extensions/api/capture_web_contents_function.h" 12 #include "chrome/browser/extensions/api/capture_web_contents_function.h"
13 #include "chrome/browser/extensions/api/execute_code_function.h" 13 #include "chrome/browser/extensions/api/execute_code_function.h"
14 #include "chrome/browser/extensions/chrome_extension_function.h" 14 #include "chrome/browser/extensions/chrome_extension_function.h"
15 #include "chrome/browser/ui/zoom/zoom_controller.h"
15 #include "chrome/common/extensions/api/tabs.h" 16 #include "chrome/common/extensions/api/tabs.h"
16 #include "content/public/browser/notification_observer.h" 17 #include "content/public/browser/notification_observer.h"
17 #include "content/public/browser/notification_registrar.h" 18 #include "content/public/browser/notification_registrar.h"
18 #include "extensions/common/extension_resource.h" 19 #include "extensions/common/extension_resource.h"
19 #include "extensions/common/user_script.h" 20 #include "extensions/common/user_script.h"
20 #include "url/gurl.h" 21 #include "url/gurl.h"
21 22
22 class GURL; 23 class GURL;
23 class SkBitmap; 24 class SkBitmap;
24 class TabStripModel; 25 class TabStripModel;
25 26
26 namespace base { 27 namespace base {
27 class DictionaryValue; 28 class DictionaryValue;
28 } 29 }
29 30
30 namespace content { 31 namespace content {
31 class WebContents; 32 class WebContents;
32 } 33 }
33 34
34 namespace ui { 35 namespace ui {
35 class ListSelectionModel; 36 class ListSelectionModel;
36 } 37 }
37 38
38 namespace user_prefs { 39 namespace user_prefs {
39 class PrefRegistrySyncable; 40 class PrefRegistrySyncable;
40 } 41 }
41 42
42 namespace extensions { 43 namespace extensions {
43 44
45 // Converts a ZoomMode to its ZoomSettings representation.
46 void ZoomModeToZoomSettings(ZoomController::ZoomMode zoom_mode,
47 api::tabs::ZoomSettings* zoom_settings);
48
44 // Windows 49 // Windows
45 class WindowsGetFunction : public ChromeSyncExtensionFunction { 50 class WindowsGetFunction : public ChromeSyncExtensionFunction {
46 virtual ~WindowsGetFunction() {} 51 virtual ~WindowsGetFunction() {}
47 virtual bool RunSync() OVERRIDE; 52 virtual bool RunSync() OVERRIDE;
48 DECLARE_EXTENSION_FUNCTION("windows.get", WINDOWS_GET) 53 DECLARE_EXTENSION_FUNCTION("windows.get", WINDOWS_GET)
49 }; 54 };
50 class WindowsGetCurrentFunction : public ChromeSyncExtensionFunction { 55 class WindowsGetCurrentFunction : public ChromeSyncExtensionFunction {
51 virtual ~WindowsGetCurrentFunction() {} 56 virtual ~WindowsGetCurrentFunction() {}
52 virtual bool RunSync() OVERRIDE; 57 virtual bool RunSync() OVERRIDE;
53 DECLARE_EXTENSION_FUNCTION("windows.getCurrent", WINDOWS_GETCURRENT) 58 DECLARE_EXTENSION_FUNCTION("windows.getCurrent", WINDOWS_GETCURRENT)
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 252
248 class TabsInsertCSSFunction : public ExecuteCodeInTabFunction { 253 class TabsInsertCSSFunction : public ExecuteCodeInTabFunction {
249 private: 254 private:
250 virtual ~TabsInsertCSSFunction() {} 255 virtual ~TabsInsertCSSFunction() {}
251 256
252 virtual bool ShouldInsertCSS() const OVERRIDE; 257 virtual bool ShouldInsertCSS() const OVERRIDE;
253 258
254 DECLARE_EXTENSION_FUNCTION("tabs.insertCSS", TABS_INSERTCSS) 259 DECLARE_EXTENSION_FUNCTION("tabs.insertCSS", TABS_INSERTCSS)
255 }; 260 };
256 261
262 class ZoomAPIFunction : public ChromeAsyncExtensionFunction {
263 protected:
264 virtual ~ZoomAPIFunction() {}
265
266 // Gets the WebContents for |tab_id| if it is specified. Otherwise get the
267 // WebContents for the active tab in the current window. Calling this function
268 // may set error_.
269 //
270 // TODO(...) many other tabs API functions use similar behavior. There should
271 // be a way to share this implementation somehow.
272 content::WebContents* GetWebContents(int tab_id);
273 };
274
275 class TabsSetZoomFunction : public ZoomAPIFunction {
276 private:
277 virtual ~TabsSetZoomFunction() {}
278
279 virtual bool RunAsync() OVERRIDE;
280
281 DECLARE_EXTENSION_FUNCTION("tabs.setZoom", TABS_SETZOOM)
282 };
283
284 class TabsGetZoomFunction : public ZoomAPIFunction {
285 private:
286 virtual ~TabsGetZoomFunction() {}
287
288 virtual bool RunAsync() OVERRIDE;
289
290 DECLARE_EXTENSION_FUNCTION("tabs.getZoom", TABS_GETZOOM)
291 };
292
293 class TabsSetZoomSettingsFunction : public ZoomAPIFunction {
294 private:
295 virtual ~TabsSetZoomSettingsFunction() {}
296
297 virtual bool RunAsync() OVERRIDE;
298
299 DECLARE_EXTENSION_FUNCTION("tabs.setZoomSettings", TABS_SETZOOMSETTINGS)
300 };
301
302 class TabsGetZoomSettingsFunction : public ZoomAPIFunction {
303 private:
304 virtual ~TabsGetZoomSettingsFunction() {}
305
306 virtual bool RunAsync() OVERRIDE;
307
308 DECLARE_EXTENSION_FUNCTION("tabs.getZoomSettings", TABS_GETZOOMSETTINGS)
309 };
310
257 } // namespace extensions 311 } // namespace extensions
258 312
259 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_ 313 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698