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

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

Issue 9150052: Re-land alexbost's experimental Offscreen Tabs API work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor test cleanups. Created 8 years, 11 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) 2011 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_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 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 }; 102 };
103 class HighlightTabsFunction : public SyncExtensionFunction { 103 class HighlightTabsFunction : public SyncExtensionFunction {
104 virtual ~HighlightTabsFunction() {} 104 virtual ~HighlightTabsFunction() {}
105 virtual bool RunImpl() OVERRIDE; 105 virtual bool RunImpl() OVERRIDE;
106 DECLARE_EXTENSION_FUNCTION_NAME("tabs.highlight") 106 DECLARE_EXTENSION_FUNCTION_NAME("tabs.highlight")
107 }; 107 };
108 class UpdateTabFunction : public AsyncExtensionFunction, 108 class UpdateTabFunction : public AsyncExtensionFunction,
109 public content::WebContentsObserver { 109 public content::WebContentsObserver {
110 public: 110 public:
111 UpdateTabFunction(); 111 UpdateTabFunction();
112 protected:
113 virtual ~UpdateTabFunction() {}
112 private: 114 private:
113 virtual ~UpdateTabFunction() {}
114 virtual bool RunImpl() OVERRIDE; 115 virtual bool RunImpl() OVERRIDE;
115 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 116 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
116 void OnExecuteCodeFinished(int request_id, 117 void OnExecuteCodeFinished(int request_id,
117 bool success, 118 bool success,
118 const std::string& error); 119 const std::string& error);
119 DECLARE_EXTENSION_FUNCTION_NAME("tabs.update") 120 DECLARE_EXTENSION_FUNCTION_NAME("tabs.update")
120 }; 121 };
121 class MoveTabsFunction : public SyncExtensionFunction { 122 class MoveTabsFunction : public SyncExtensionFunction {
122 virtual ~MoveTabsFunction() {} 123 virtual ~MoveTabsFunction() {}
123 virtual bool RunImpl() OVERRIDE; 124 virtual bool RunImpl() OVERRIDE;
(...skipping 17 matching lines...) Expand all
141 142
142 virtual void Observe(int type, 143 virtual void Observe(int type,
143 const content::NotificationSource& source, 144 const content::NotificationSource& source,
144 const content::NotificationDetails& details) OVERRIDE; 145 const content::NotificationDetails& details) OVERRIDE;
145 void GotLanguage(const std::string& language); 146 void GotLanguage(const std::string& language);
146 content::NotificationRegistrar registrar_; 147 content::NotificationRegistrar registrar_;
147 DECLARE_EXTENSION_FUNCTION_NAME("tabs.detectLanguage") 148 DECLARE_EXTENSION_FUNCTION_NAME("tabs.detectLanguage")
148 }; 149 };
149 class CaptureVisibleTabFunction : public AsyncExtensionFunction, 150 class CaptureVisibleTabFunction : public AsyncExtensionFunction,
150 public content::NotificationObserver { 151 public content::NotificationObserver {
151 private: 152 protected:
152 enum ImageFormat { 153 enum ImageFormat {
153 FORMAT_JPEG, 154 FORMAT_JPEG,
154 FORMAT_PNG 155 FORMAT_PNG
155 }; 156 };
156 157
157 // The default quality setting used when encoding jpegs. 158 // The default quality setting used when encoding jpegs.
158 static const int kDefaultQuality; 159 static const int kDefaultQuality;
159 160
160 virtual ~CaptureVisibleTabFunction() {} 161 virtual ~CaptureVisibleTabFunction() {}
161 virtual bool RunImpl() OVERRIDE; 162 virtual bool RunImpl() OVERRIDE;
162 virtual bool CaptureSnapshotFromBackingStore(BackingStore* backing_store); 163 virtual bool CaptureSnapshotFromBackingStore(BackingStore* backing_store);
163 virtual void Observe(int type, 164 virtual void Observe(int type,
164 const content::NotificationSource& source, 165 const content::NotificationSource& source,
165 const content::NotificationDetails& details) OVERRIDE; 166 const content::NotificationDetails& details) OVERRIDE;
166 virtual void SendResultFromBitmap(const SkBitmap& screen_capture); 167 virtual void SendResultFromBitmap(const SkBitmap& screen_capture);
167 168
168 content::NotificationRegistrar registrar_; 169 content::NotificationRegistrar registrar_;
169 170
170 // The format (JPEG vs PNG) of the resulting image. Set in RunImpl(). 171 // The format (JPEG vs PNG) of the resulting image. Set in RunImpl().
171 ImageFormat image_format_; 172 ImageFormat image_format_;
172 173
173 // Quality setting to use when encoding jpegs. Set in RunImpl(). 174 // Quality setting to use when encoding jpegs. Set in RunImpl().
174 int image_quality_; 175 int image_quality_;
175 176
176 DECLARE_EXTENSION_FUNCTION_NAME("tabs.captureVisibleTab") 177 DECLARE_EXTENSION_FUNCTION_NAME("tabs.captureVisibleTab")
177 }; 178 };
178 179
179 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__ 180 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_offscreen_tabs_module_constants.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698