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

Side by Side Diff: chrome/browser/extensions/api/tab_capture/tab_capture_api.cc

Issue 1224643008: Add a fake cast extension for testing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 5 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
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 // Implements the Chrome Extensions Tab Capture API. 5 // Implements the Chrome Extensions Tab Capture API.
6 6
7 #include "chrome/browser/extensions/api/tab_capture/tab_capture_api.h" 7 #include "chrome/browser/extensions/api/tab_capture/tab_capture_api.h"
8 8
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // they provide API's. If there are additional extension ids that need 58 // they provide API's. If there are additional extension ids that need
59 // whitelisting and are *not* the Chromecast extension, add them to a new 59 // whitelisting and are *not* the Chromecast extension, add them to a new
60 // kWhitelist array. 60 // kWhitelist array.
61 const char* const kChromecastExtensionIds[] = { 61 const char* const kChromecastExtensionIds[] = {
62 "enhhojjnijigcajfphajepfemndkmdlo", // Dev 62 "enhhojjnijigcajfphajepfemndkmdlo", // Dev
63 "pkedcjkdefgpdelpbcmbmeomcjbeemfm", // Dogfood 63 "pkedcjkdefgpdelpbcmbmeomcjbeemfm", // Dogfood
64 "fmfcbgogabcbclcofgocippekhfcmgfj", // Staging 64 "fmfcbgogabcbclcofgocippekhfcmgfj", // Staging
65 "hfaagokkkhdbgiakmmlclaapfelnkoah", // Canary 65 "hfaagokkkhdbgiakmmlclaapfelnkoah", // Canary
66 "dliochdbjfkdbacpmhlcpmleaejidimm", // Google Cast Beta 66 "dliochdbjfkdbacpmhlcpmleaejidimm", // Google Cast Beta
67 "boadgeojelhgndaghljhdicfkmllpafd", // Google Cast Stable 67 "boadgeojelhgndaghljhdicfkmllpafd", // Google Cast Stable
68 // Mock extension for testing, under /chrome/test/data/extensions/tray_cast
69 "hlgmmjhlnlapooncikdpiiokdjcdpjme",
achuithb 2015/07/08 22:23:55 Personally I think a comment like // Test cast ext
jdufault 2015/07/09 19:30:02 Done, using the string to search instead of hardco
68 }; 70 };
69 71
70 bool TabCaptureCaptureFunction::RunSync() { 72 bool TabCaptureCaptureFunction::RunSync() {
71 scoped_ptr<api::tab_capture::Capture::Params> params = 73 scoped_ptr<api::tab_capture::Capture::Params> params =
72 TabCapture::Capture::Params::Create(*args_); 74 TabCapture::Capture::Params::Create(*args_);
73 EXTENSION_FUNCTION_VALIDATE(params.get()); 75 EXTENSION_FUNCTION_VALIDATE(params.get());
74 76
75 // Figure out the active WebContents and retrieve the needed ids. 77 // Figure out the active WebContents and retrieve the needed ids.
76 Browser* target_browser = chrome::FindAnyBrowser( 78 Browser* target_browser = chrome::FindAnyBrowser(
77 GetProfile(), include_incognito(), chrome::GetActiveDesktop()); 79 GetProfile(), include_incognito(), chrome::GetActiveDesktop());
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 bool TabCaptureGetCapturedTabsFunction::RunSync() { 181 bool TabCaptureGetCapturedTabsFunction::RunSync() {
180 TabCaptureRegistry* registry = TabCaptureRegistry::Get(GetProfile()); 182 TabCaptureRegistry* registry = TabCaptureRegistry::Get(GetProfile());
181 base::ListValue* const list = new base::ListValue(); 183 base::ListValue* const list = new base::ListValue();
182 if (registry) 184 if (registry)
183 registry->GetCapturedTabs(extension()->id(), list); 185 registry->GetCapturedTabs(extension()->id(), list);
184 SetResult(list); 186 SetResult(list);
185 return true; 187 return true;
186 } 188 }
187 189
188 } // namespace extensions 190 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698