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

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

Issue 4234004: Fix some UI issues with omnibox extensions in incognito. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 10 years, 1 month 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_dispatcher.h" 5 #include "chrome/browser/extensions/extension_function_dispatcher.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/process_util.h" 9 #include "base/process_util.h"
10 #include "base/singleton.h" 10 #include "base/singleton.h"
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 function->set_extension_id(extension_id()); 443 function->set_extension_id(extension_id());
444 function->SetArgs(&params.arguments); 444 function->SetArgs(&params.arguments);
445 function->set_source_url(params.source_url); 445 function->set_source_url(params.source_url);
446 function->set_request_id(params.request_id); 446 function->set_request_id(params.request_id);
447 function->set_has_callback(params.has_callback); 447 function->set_has_callback(params.has_callback);
448 function->set_user_gesture(params.user_gesture); 448 function->set_user_gesture(params.user_gesture);
449 ExtensionsService* service = profile()->GetExtensionsService(); 449 ExtensionsService* service = profile()->GetExtensionsService();
450 DCHECK(service); 450 DCHECK(service);
451 const Extension* extension = service->GetExtensionById(extension_id(), false); 451 const Extension* extension = service->GetExtensionById(extension_id(), false);
452 DCHECK(extension); 452 DCHECK(extension);
453 function->set_include_incognito(service->IsIncognitoEnabled(extension) && 453 function->set_include_incognito(service->CanCrossIncognito(extension));
454 !extension->incognito_split_mode());
455 454
456 if (!service->ExtensionBindingsAllowed(function->source_url()) || 455 if (!service->ExtensionBindingsAllowed(function->source_url()) ||
457 !extension->HasApiPermission(function->name())) { 456 !extension->HasApiPermission(function->name())) {
458 render_view_host_->BlockExtensionRequest(function->request_id()); 457 render_view_host_->BlockExtensionRequest(function->request_id());
459 return; 458 return;
460 } 459 }
461 460
462 ExtensionsQuotaService* quota = service->quota_service(); 461 ExtensionsQuotaService* quota = service->quota_service();
463 if (quota->Assess(extension_id(), function, &params.arguments, 462 if (quota->Assess(extension_id(), function, &params.arguments,
464 base::TimeTicks::Now())) { 463 base::TimeTicks::Now())) {
(...skipping 23 matching lines...) Expand all
488 } else { 487 } else {
489 NOTREACHED(); 488 NOTREACHED();
490 base::KillProcess(render_view_host_->process()->GetHandle(), 489 base::KillProcess(render_view_host_->process()->GetHandle(),
491 ResultCodes::KILLED_BAD_MESSAGE, false); 490 ResultCodes::KILLED_BAD_MESSAGE, false);
492 } 491 }
493 } 492 }
494 493
495 Profile* ExtensionFunctionDispatcher::profile() { 494 Profile* ExtensionFunctionDispatcher::profile() {
496 return profile_; 495 return profile_;
497 } 496 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_event_router.cc ('k') | chrome/browser/extensions/extensions_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698