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

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

Issue 221283006: Revert of Fix the handling of user gestures for external protocol handler dialogs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/extension_function_dispatcher.h" 5 #include "extensions/browser/extension_function_dispatcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/json/json_string_value_serializer.h" 8 #include "base/json/json_string_value_serializer.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 375
376 ExtensionSystem* extension_system = ExtensionSystem::Get(browser_context_); 376 ExtensionSystem* extension_system = ExtensionSystem::Get(browser_context_);
377 extensions::QuotaService* quota = extension_system->quota_service(); 377 extensions::QuotaService* quota = extension_system->quota_service();
378 std::string violation_error = quota->Assess(extension->id(), 378 std::string violation_error = quota->Assess(extension->id(),
379 function.get(), 379 function.get(),
380 &params.arguments, 380 &params.arguments,
381 base::TimeTicks::Now()); 381 base::TimeTicks::Now());
382 if (violation_error.empty()) { 382 if (violation_error.empty()) {
383 scoped_ptr<base::ListValue> args(params.arguments.DeepCopy()); 383 scoped_ptr<base::ListValue> args(params.arguments.DeepCopy());
384 384
385 // See crbug.com/39178.
386 ExtensionsBrowserClient::Get()->PermitExternalProtocolHandler();
385 NotifyApiFunctionCalled( 387 NotifyApiFunctionCalled(
386 extension->id(), params.name, args.Pass(), browser_context_); 388 extension->id(), params.name, args.Pass(), browser_context_);
387 function->Run(); 389 function->Run();
388 } else { 390 } else {
389 function->OnQuotaExceeded(violation_error); 391 function->OnQuotaExceeded(violation_error);
390 } 392 }
391 393
392 // Note: do not access |this| after this point. We may have been deleted 394 // Note: do not access |this| after this point. We may have been deleted
393 // if function->Run() ended up closing the tab that owns us. 395 // if function->Run() ended up closing the tab that owns us.
394 396
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 return function; 510 return function;
509 } 511 }
510 512
511 // static 513 // static
512 void ExtensionFunctionDispatcher::SendAccessDenied( 514 void ExtensionFunctionDispatcher::SendAccessDenied(
513 const ExtensionFunction::ResponseCallback& callback) { 515 const ExtensionFunction::ResponseCallback& callback) {
514 base::ListValue empty_list; 516 base::ListValue empty_list;
515 callback.Run(ExtensionFunction::FAILED, empty_list, 517 callback.Run(ExtensionFunction::FAILED, empty_list,
516 "Access to extension API denied."); 518 "Access to extension API denied.");
517 } 519 }
OLDNEW
« no previous file with comments | « content/public/browser/resource_dispatcher_host_delegate.cc ('k') | extensions/browser/extensions_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698