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

Side by Side Diff: chrome/browser/extensions/extension_function.cc

Issue 10407035: Extension/Platform App window isolation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests Created 8 years, 7 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 #include "chrome/browser/extensions/extension_function.h" 5 #include "chrome/browser/extensions/extension_function.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "chrome/browser/extensions/extension_function_dispatcher.h" 9 #include "chrome/browser/extensions/extension_function_dispatcher.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 } 212 }
213 213
214 ExtensionWindowController* 214 ExtensionWindowController*
215 UIThreadExtensionFunction::GetExtensionWindowController() { 215 UIThreadExtensionFunction::GetExtensionWindowController() {
216 // If the delegate has an associated window controller, return it. 216 // If the delegate has an associated window controller, return it.
217 ExtensionWindowController* window_controller = 217 ExtensionWindowController* window_controller =
218 dispatcher()->delegate()->GetExtensionWindowController(); 218 dispatcher()->delegate()->GetExtensionWindowController();
219 if (window_controller) 219 if (window_controller)
220 return window_controller; 220 return window_controller;
221 221
222 Profile* profile = Profile::FromBrowserContext( 222 return ExtensionWindowList::GetInstance()->CurrentWindow(this);
223 render_view_host_->GetProcess()->GetBrowserContext());
224 ExtensionWindowList::ProfileMatchType match_type = include_incognito_
225 ? ExtensionWindowController::MATCH_INCOGNITO
226 : ExtensionWindowController::MATCH_NORMAL_ONLY;
227 return ExtensionWindowList::GetInstance()->CurrentWindow(profile, match_type);
228 } 223 }
229 224
230 void UIThreadExtensionFunction::SendResponse(bool success) { 225 void UIThreadExtensionFunction::SendResponse(bool success) {
231 if (delegate_) { 226 if (delegate_) {
232 delegate_->OnSendResponse(this, success, bad_message_); 227 delegate_->OnSendResponse(this, success, bad_message_);
233 } else { 228 } else {
234 if (!render_view_host_ || !dispatcher()) 229 if (!render_view_host_ || !dispatcher())
235 return; 230 return;
236 231
237 SendResponseImpl(render_view_host_->GetProcess()->GetHandle(), 232 SendResponseImpl(render_view_host_->GetProcess()->GetHandle(),
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 278
284 SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() { 279 SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() {
285 } 280 }
286 281
287 SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() { 282 SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() {
288 } 283 }
289 284
290 void SyncIOThreadExtensionFunction::Run() { 285 void SyncIOThreadExtensionFunction::Run() {
291 SendResponse(RunImpl()); 286 SendResponse(RunImpl());
292 } 287 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698