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

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

Issue 11451006: Make TabCapture requests use the target render process and render view id's for UI permissions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments Created 8 years 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 // 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 "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 result->SetString(std::string("audioConstraints.mandatory.") + 110 result->SetString(std::string("audioConstraints.mandatory.") +
111 kMediaStreamSource, kMediaStreamSourceTab); 111 kMediaStreamSource, kMediaStreamSourceTab);
112 result->SetString(std::string("audioConstraints.mandatory.") + 112 result->SetString(std::string("audioConstraints.mandatory.") +
113 kMediaStreamSourceId, device_id); 113 kMediaStreamSourceId, device_id);
114 } else { 114 } else {
115 result->SetBoolean(std::string("audioConstraints"), false); 115 result->SetBoolean(std::string("audioConstraints"), false);
116 } 116 }
117 117
118 extensions::TabCaptureRegistry* registry = 118 extensions::TabCaptureRegistry* registry =
119 extensions::TabCaptureRegistryFactory::GetForProfile(profile()); 119 extensions::TabCaptureRegistryFactory::GetForProfile(profile());
120 if (!registry->AddRequest(device_id, TabCaptureRegistry::TabCaptureRequest( 120 if (!registry->AddRequest(
121 GetExtension()->id(), tab_id, 121 std::make_pair(render_process_id, routing_id),
122 tab_capture::TAB_CAPTURE_TAB_CAPTURE_STATE_NONE))) { 122 TabCaptureRegistry::TabCaptureRequest(
123 GetExtension()->id(), tab_id,
124 tab_capture::TAB_CAPTURE_TAB_CAPTURE_STATE_NONE))) {
123 error_ = kCapturingSameTab; 125 error_ = kCapturingSameTab;
124 SetResult(base::Value::CreateIntegerValue(0)); 126 SetResult(base::Value::CreateIntegerValue(0));
125 return false; 127 return false;
126 } 128 }
127 129
128 SetResult(result); 130 SetResult(result);
129 return true; 131 return true;
130 } 132 }
131 133
132 bool TabCaptureGetCapturedTabsFunction::RunImpl() { 134 bool TabCaptureGetCapturedTabsFunction::RunImpl() {
(...skipping 16 matching lines...) Expand all
149 info->tab_id = it->tab_id; 151 info->tab_id = it->tab_id;
150 info->status = it->status; 152 info->status = it->status;
151 list->Append(info->ToValue().release()); 153 list->Append(info->ToValue().release());
152 } 154 }
153 155
154 SetResult(list); 156 SetResult(list);
155 return true; 157 return true;
156 } 158 }
157 159
158 } // namespace extensions 160 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698