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

Side by Side Diff: chrome/browser/extensions/api/desktop_capture/desktop_capture_api.cc

Issue 126433003: Allow Desktop Capture API from incognito tabs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "chrome/browser/extensions/api/desktop_capture/desktop_capture_api.h" 5 #include "chrome/browser/extensions/api/desktop_capture/desktop_capture_api.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/extensions/extension_tab_util.h" 9 #include "chrome/browser/extensions/extension_tab_util.h"
10 #include "chrome/browser/media/desktop_media_list_ash.h" 10 #include "chrome/browser/media/desktop_media_list_ash.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 return false; 93 return false;
94 } 94 }
95 origin_ = GURL(*(params->target_tab->url)).GetOrigin(); 95 origin_ = GURL(*(params->target_tab->url)).GetOrigin();
96 96
97 if (!params->target_tab->id) { 97 if (!params->target_tab->id) {
98 error_ = kNoTabIdError; 98 error_ = kNoTabIdError;
99 return false; 99 return false;
100 } 100 }
101 101
102 content::WebContents* web_contents = NULL; 102 content::WebContents* web_contents = NULL;
103 if (!ExtensionTabUtil::GetTabById(*(params->target_tab->id), 103 if (!ExtensionTabUtil::GetTabById(*(params->target_tab->id), GetProfile(),
104 GetProfile(), 104 true, NULL, NULL, &web_contents, NULL)) {
105 false,
106 NULL,
107 NULL,
108 &web_contents,
109 NULL)) {
110 error_ = kInvalidTabIdError; 105 error_ = kInvalidTabIdError;
111 return false; 106 return false;
112 } 107 }
113 108
114 GURL current_origin_ = 109 GURL current_origin_ =
115 web_contents->GetLastCommittedURL().GetOrigin(); 110 web_contents->GetLastCommittedURL().GetOrigin();
116 if (current_origin_ != origin_) { 111 if (current_origin_ != origin_) {
117 error_ = kTabUrlChangedError; 112 error_ = kTabUrlChangedError;
118 return false; 113 return false;
119 } 114 }
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 266
272 void DesktopCaptureRequestsRegistry::CancelRequest(int process_id, 267 void DesktopCaptureRequestsRegistry::CancelRequest(int process_id,
273 int request_id) { 268 int request_id) {
274 RequestsMap::iterator it = requests_.find(RequestId(process_id, request_id)); 269 RequestsMap::iterator it = requests_.find(RequestId(process_id, request_id));
275 if (it != requests_.end()) 270 if (it != requests_.end())
276 it->second->Cancel(); 271 it->second->Cancel();
277 } 272 }
278 273
279 274
280 } // namespace extensions 275 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698