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

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

Issue 225093019: Zoom Extension API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 24 matching lines...) Expand all
35 namespace ui { 35 namespace ui {
36 class ListSelectionModel; 36 class ListSelectionModel;
37 } 37 }
38 38
39 namespace user_prefs { 39 namespace user_prefs {
40 class PrefRegistrySyncable; 40 class PrefRegistrySyncable;
41 } 41 }
42 42
43 namespace extensions { 43 namespace extensions {
44 44
45 // Converts a ZoomMode to its zoom settings dictionary object representation.
46 void ZoomModeToZoomSettings(content::ZoomMode zoom_mode,
47 base::DictionaryValue* zoom_settings);
48
45 // Windows 49 // Windows
46 class WindowsGetFunction : public ChromeSyncExtensionFunction { 50 class WindowsGetFunction : public ChromeSyncExtensionFunction {
47 virtual ~WindowsGetFunction() {} 51 virtual ~WindowsGetFunction() {}
48 virtual bool RunImpl() OVERRIDE; 52 virtual bool RunImpl() OVERRIDE;
49 DECLARE_EXTENSION_FUNCTION("windows.get", WINDOWS_GET) 53 DECLARE_EXTENSION_FUNCTION("windows.get", WINDOWS_GET)
50 }; 54 };
51 class WindowsGetCurrentFunction : public ChromeSyncExtensionFunction { 55 class WindowsGetCurrentFunction : public ChromeSyncExtensionFunction {
52 virtual ~WindowsGetCurrentFunction() {} 56 virtual ~WindowsGetCurrentFunction() {}
53 virtual bool RunImpl() OVERRIDE; 57 virtual bool RunImpl() OVERRIDE;
54 DECLARE_EXTENSION_FUNCTION("windows.getCurrent", WINDOWS_GETCURRENT) 58 DECLARE_EXTENSION_FUNCTION("windows.getCurrent", WINDOWS_GETCURRENT)
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 253
250 class TabsInsertCSSFunction : public ExecuteCodeInTabFunction { 254 class TabsInsertCSSFunction : public ExecuteCodeInTabFunction {
251 private: 255 private:
252 virtual ~TabsInsertCSSFunction() {} 256 virtual ~TabsInsertCSSFunction() {}
253 257
254 virtual bool ShouldInsertCSS() const OVERRIDE; 258 virtual bool ShouldInsertCSS() const OVERRIDE;
255 259
256 DECLARE_EXTENSION_FUNCTION("tabs.insertCSS", TABS_INSERTCSS) 260 DECLARE_EXTENSION_FUNCTION("tabs.insertCSS", TABS_INSERTCSS)
257 }; 261 };
258 262
263 class ZoomAPIFunction : public ChromeAsyncExtensionFunction {
264 protected:
265 virtual ~ZoomAPIFunction() {}
266
267 // Gets the WebContents for |tab_id| if it is specified. Otherwise get the
268 // WebContents for the active tab in the current window.
269 bool GetWebContents(int* tab_id, content::WebContents** web_contents);
270 };
271
272 class TabsSetZoomFunction : public ZoomAPIFunction,
273 public content::NotificationObserver {
274 public:
275 TabsSetZoomFunction();
276
277 private:
278 virtual ~TabsSetZoomFunction() {}
279
280 virtual bool RunImpl() OVERRIDE;
281
282 // content::NotificationObserver.
283 virtual void Observe(int type,
284 const content::NotificationSource& source,
285 const content::NotificationDetails& details) OVERRIDE;
286
287 // The unique identifier of this initiated zoom change.
288 int zoom_id_;
289
290 content::NotificationRegistrar registrar_;
291
292 DECLARE_EXTENSION_FUNCTION("tabs.setZoom", TABS_SETZOOM)
293 };
294
295 class TabsGetZoomFunction : public ZoomAPIFunction {
296 private:
297 virtual ~TabsGetZoomFunction() {}
298
299 virtual bool RunImpl() OVERRIDE;
300
301 DECLARE_EXTENSION_FUNCTION("tabs.getZoom", TABS_GETZOOM)
302 };
303
304 class TabsSetZoomSettingsFunction : public ZoomAPIFunction {
305 private:
306 virtual ~TabsSetZoomSettingsFunction() {}
307
308 virtual bool RunImpl() OVERRIDE;
309
310 DECLARE_EXTENSION_FUNCTION("tabs.setZoomSettings", TABS_SETZOOMSETTINGS)
311 };
312
313 class TabsGetZoomSettingsFunction : public ZoomAPIFunction {
314 private:
315 virtual ~TabsGetZoomSettingsFunction() {}
316
317 virtual bool RunImpl() OVERRIDE;
318
319 DECLARE_EXTENSION_FUNCTION("tabs.getZoomSettings", TABS_GETZOOMSETTINGS)
320 };
321
259 } // namespace extensions 322 } // namespace extensions
260 323
261 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_ 324 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698