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

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

Issue 426713002: 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: Rebase Created 6 years, 4 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 ExtensionSystem* extension_system = ExtensionSystem::Get(browser_context_); 375 ExtensionSystem* extension_system = ExtensionSystem::Get(browser_context_);
376 QuotaService* quota = extension_system->quota_service(); 376 QuotaService* quota = extension_system->quota_service();
377 std::string violation_error = quota->Assess(extension->id(), 377 std::string violation_error = quota->Assess(extension->id(),
378 function.get(), 378 function.get(),
379 &params.arguments, 379 &params.arguments,
380 base::TimeTicks::Now()); 380 base::TimeTicks::Now());
381 381
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 UMA_HISTOGRAM_SPARSE_SLOWLY("Extensions.FunctionCalls", 389 UMA_HISTOGRAM_SPARSE_SLOWLY("Extensions.FunctionCalls",
388 function->histogram_value()); 390 function->histogram_value());
389 function->Run()->Execute(); 391 function->Run()->Execute();
390 } else { 392 } else {
391 function->OnQuotaExceeded(violation_error); 393 function->OnQuotaExceeded(violation_error);
392 } 394 }
393 395
394 // Note: do not access |this| after this point. We may have been deleted 396 // Note: do not access |this| after this point. We may have been deleted
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 529
528 // static 530 // static
529 void ExtensionFunctionDispatcher::SendAccessDenied( 531 void ExtensionFunctionDispatcher::SendAccessDenied(
530 const ExtensionFunction::ResponseCallback& callback) { 532 const ExtensionFunction::ResponseCallback& callback) {
531 base::ListValue empty_list; 533 base::ListValue empty_list;
532 callback.Run(ExtensionFunction::FAILED, empty_list, 534 callback.Run(ExtensionFunction::FAILED, empty_list,
533 "Access to extension API denied."); 535 "Access to extension API denied.");
534 } 536 }
535 537
536 } // namespace extensions 538 } // namespace extensions
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