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

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

Issue 436703002: Revert external protocol handler user gesture fix on M36 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1985/src
Patch Set: 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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 371
372 ExtensionSystem* extension_system = ExtensionSystem::Get(browser_context_); 372 ExtensionSystem* extension_system = ExtensionSystem::Get(browser_context_);
373 QuotaService* quota = extension_system->quota_service(); 373 QuotaService* quota = extension_system->quota_service();
374 std::string violation_error = quota->Assess(extension->id(), 374 std::string violation_error = quota->Assess(extension->id(),
375 function.get(), 375 function.get(),
376 &params.arguments, 376 &params.arguments,
377 base::TimeTicks::Now()); 377 base::TimeTicks::Now());
378 if (violation_error.empty()) { 378 if (violation_error.empty()) {
379 scoped_ptr<base::ListValue> args(params.arguments.DeepCopy()); 379 scoped_ptr<base::ListValue> args(params.arguments.DeepCopy());
380 380
381 // See crbug.com/39178.
382 ExtensionsBrowserClient::Get()->PermitExternalProtocolHandler();
381 NotifyApiFunctionCalled( 383 NotifyApiFunctionCalled(
382 extension->id(), params.name, args.Pass(), browser_context_); 384 extension->id(), params.name, args.Pass(), browser_context_);
383 UMA_HISTOGRAM_SPARSE_SLOWLY("Extensions.FunctionCalls", 385 UMA_HISTOGRAM_SPARSE_SLOWLY("Extensions.FunctionCalls",
384 function->histogram_value()); 386 function->histogram_value());
385 function->Run()->Execute(); 387 function->Run()->Execute();
386 } else { 388 } else {
387 function->OnQuotaExceeded(violation_error); 389 function->OnQuotaExceeded(violation_error);
388 } 390 }
389 391
390 // Note: do not access |this| after this point. We may have been deleted 392 // Note: do not access |this| after this point. We may have been deleted
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 510
509 // static 511 // static
510 void ExtensionFunctionDispatcher::SendAccessDenied( 512 void ExtensionFunctionDispatcher::SendAccessDenied(
511 const ExtensionFunction::ResponseCallback& callback) { 513 const ExtensionFunction::ResponseCallback& callback) {
512 base::ListValue empty_list; 514 base::ListValue empty_list;
513 callback.Run(ExtensionFunction::FAILED, empty_list, 515 callback.Run(ExtensionFunction::FAILED, empty_list,
514 "Access to extension API denied."); 516 "Access to extension API denied.");
515 } 517 }
516 518
517 } // namespace extensions 519 } // 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