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

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

Issue 11827026: Overhaul JSON Schema Compiler to support a number of features required to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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) 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 constraint->SetString(kMediaStreamSource, kMediaStreamSourceTab); 110 constraint->SetString(kMediaStreamSource, kMediaStreamSourceTab);
111 constraint->SetString(kMediaStreamSourceId, device_id); 111 constraint->SetString(kMediaStreamSourceId, device_id);
112 } 112 }
113 113
114 extensions::TabCaptureRegistry* registry = 114 extensions::TabCaptureRegistry* registry =
115 extensions::TabCaptureRegistryFactory::GetForProfile(profile()); 115 extensions::TabCaptureRegistryFactory::GetForProfile(profile());
116 if (!registry->AddRequest( 116 if (!registry->AddRequest(
117 std::make_pair(render_process_id, routing_id), 117 std::make_pair(render_process_id, routing_id),
118 TabCaptureRegistry::TabCaptureRequest( 118 TabCaptureRegistry::TabCaptureRequest(
119 GetExtension()->id(), tab_id, 119 GetExtension()->id(), tab_id,
120 tab_capture::TAB_CAPTURE_TAB_CAPTURE_STATE_NONE))) { 120 tab_capture::TAB_CAPTURE_STATE_NONE))) {
121 error_ = kCapturingSameTab; 121 error_ = kCapturingSameTab;
122 return false; 122 return false;
123 } 123 }
124 124
125 // Copy the result from our modified input parameters. This will be 125 // Copy the result from our modified input parameters. This will be
126 // intercepted by custom bindings which will build and send the special 126 // intercepted by custom bindings which will build and send the special
127 // WebRTC user media request. 127 // WebRTC user media request.
128 base::DictionaryValue* result = new base::DictionaryValue(); 128 base::DictionaryValue* result = new base::DictionaryValue();
129 result->MergeDictionary(params->options.ToValue().get()); 129 result->MergeDictionary(params->options.ToValue().get());
130 130
(...skipping 20 matching lines...) Expand all
151 info->tab_id = it->tab_id; 151 info->tab_id = it->tab_id;
152 info->status = it->status; 152 info->status = it->status;
153 list->Append(info->ToValue().release()); 153 list->Append(info->ToValue().release());
154 } 154 }
155 155
156 SetResult(list); 156 SetResult(list);
157 return true; 157 return true;
158 } 158 }
159 159
160 } // namespace extensions 160 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698