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

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

Issue 12881005: Allow CopyFromBackingStore to fallback to copying from the renderer side if the accelerated surface… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/tabs/tabs_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 virtual ~TabsDetectLanguageFunction() {} 167 virtual ~TabsDetectLanguageFunction() {}
168 virtual bool RunImpl() OVERRIDE; 168 virtual bool RunImpl() OVERRIDE;
169 169
170 virtual void Observe(int type, 170 virtual void Observe(int type,
171 const content::NotificationSource& source, 171 const content::NotificationSource& source,
172 const content::NotificationDetails& details) OVERRIDE; 172 const content::NotificationDetails& details) OVERRIDE;
173 void GotLanguage(const std::string& language); 173 void GotLanguage(const std::string& language);
174 content::NotificationRegistrar registrar_; 174 content::NotificationRegistrar registrar_;
175 DECLARE_EXTENSION_FUNCTION("tabs.detectLanguage", TABS_DETECTLANGUAGE) 175 DECLARE_EXTENSION_FUNCTION("tabs.detectLanguage", TABS_DETECTLANGUAGE)
176 }; 176 };
177 class TabsCaptureVisibleTabFunction : public AsyncExtensionFunction, 177 class TabsCaptureVisibleTabFunction : public AsyncExtensionFunction {
178 public content::NotificationObserver {
179 public: 178 public:
180 static void RegisterUserPrefs(PrefRegistrySyncable* registry); 179 static void RegisterUserPrefs(PrefRegistrySyncable* registry);
181 180
182 protected: 181 protected:
183 enum ImageFormat { 182 enum ImageFormat {
184 FORMAT_JPEG, 183 FORMAT_JPEG,
185 FORMAT_PNG 184 FORMAT_PNG
186 }; 185 };
187 186
188 // The default quality setting used when encoding jpegs. 187 // The default quality setting used when encoding jpegs.
189 static const int kDefaultQuality; 188 static const int kDefaultQuality;
190 189
191 virtual ~TabsCaptureVisibleTabFunction() {} 190 virtual ~TabsCaptureVisibleTabFunction() {}
192 virtual bool RunImpl() OVERRIDE; 191 virtual bool RunImpl() OVERRIDE;
193 virtual bool GetTabToCapture(content::WebContents** web_contents); 192 virtual bool GetTabToCapture(content::WebContents** web_contents);
194 virtual void Observe(int type,
195 const content::NotificationSource& source,
196 const content::NotificationDetails& details) OVERRIDE;
197 void SendResultFromBitmap(const SkBitmap& screen_capture); 193 void SendResultFromBitmap(const SkBitmap& screen_capture);
198 194
199 private: 195 private:
200 void CopyFromBackingStoreComplete(bool succeeded, 196 void CopyFromBackingStoreComplete(bool succeeded,
201 const SkBitmap& bitmap); 197 const SkBitmap& bitmap);
202 198 void GetSnapshotFromRendererComplete(bool succeeded,
sky 2013/03/22 19:39:22 Add descriptions for these methods.
203 content::NotificationRegistrar registrar_; 199 const SkBitmap& bitmap);
200 void SendInternalError();
204 201
205 // The format (JPEG vs PNG) of the resulting image. Set in RunImpl(). 202 // The format (JPEG vs PNG) of the resulting image. Set in RunImpl().
206 ImageFormat image_format_; 203 ImageFormat image_format_;
207 204
208 // Quality setting to use when encoding jpegs. Set in RunImpl(). 205 // Quality setting to use when encoding jpegs. Set in RunImpl().
209 int image_quality_; 206 int image_quality_;
210 207
211 DECLARE_EXTENSION_FUNCTION("tabs.captureVisibleTab", TABS_CAPTUREVISIBLETAB) 208 DECLARE_EXTENSION_FUNCTION("tabs.captureVisibleTab", TABS_CAPTUREVISIBLETAB)
212 }; 209 };
213 210
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 }; 274 };
278 275
279 class TabsInsertCSSFunction : public ExecuteCodeInTabFunction { 276 class TabsInsertCSSFunction : public ExecuteCodeInTabFunction {
280 private: 277 private:
281 virtual ~TabsInsertCSSFunction() {} 278 virtual ~TabsInsertCSSFunction() {}
282 279
283 DECLARE_EXTENSION_FUNCTION("tabs.insertCSS", TABS_INSERTCSS) 280 DECLARE_EXTENSION_FUNCTION("tabs.insertCSS", TABS_INSERTCSS)
284 }; 281 };
285 282
286 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_ 283 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/tabs/tabs_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698