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

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

Issue 131783012: Fix the handling of user gestures for external protocol handler dialogs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix build Created 6 years, 10 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_dispatcher.h" 5 #include "chrome/browser/extensions/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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 return; 382 return;
383 383
384 ExtensionSystem* extension_system = ExtensionSystem::Get(browser_context_); 384 ExtensionSystem* extension_system = ExtensionSystem::Get(browser_context_);
385 extensions::QuotaService* quota = extension_system->quota_service(); 385 extensions::QuotaService* quota = extension_system->quota_service();
386 std::string violation_error = quota->Assess(extension->id(), 386 std::string violation_error = quota->Assess(extension->id(),
387 function.get(), 387 function.get(),
388 &params.arguments, 388 &params.arguments,
389 base::TimeTicks::Now()); 389 base::TimeTicks::Now());
390 if (violation_error.empty()) { 390 if (violation_error.empty()) {
391 scoped_ptr<base::ListValue> args(params.arguments.DeepCopy()); 391 scoped_ptr<base::ListValue> args(params.arguments.DeepCopy());
392
393 // See crbug.com/39178.
394 ExternalProtocolHandler::PermitLaunchUrl();
395 NotifyApiFunctionCalled( 392 NotifyApiFunctionCalled(
396 extension->id(), params.name, args.Pass(), browser_context_); 393 extension->id(), params.name, args.Pass(), browser_context_);
397 function->Run(); 394 function->Run();
398 } else { 395 } else {
399 function->OnQuotaExceeded(violation_error); 396 function->OnQuotaExceeded(violation_error);
400 } 397 }
401 398
402 // Note: do not access |this| after this point. We may have been deleted 399 // Note: do not access |this| after this point. We may have been deleted
403 // if function->Run() ended up closing the tab that owns us. 400 // if function->Run() ended up closing the tab that owns us.
404 401
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 return function; 515 return function;
519 } 516 }
520 517
521 // static 518 // static
522 void ExtensionFunctionDispatcher::SendAccessDenied( 519 void ExtensionFunctionDispatcher::SendAccessDenied(
523 const ExtensionFunction::ResponseCallback& callback) { 520 const ExtensionFunction::ResponseCallback& callback) {
524 base::ListValue empty_list; 521 base::ListValue empty_list;
525 callback.Run(ExtensionFunction::FAILED, empty_list, 522 callback.Run(ExtensionFunction::FAILED, empty_list,
526 "Access to extension API denied."); 523 "Access to extension API denied.");
527 } 524 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698