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

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

Issue 2884040: Rename ExternalProtocolHandler::OnUserGesture -> PermitLaunchUrl & call from EFD::HandleRequest (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: cr changes Created 10 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/external_protocol_handler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/process_util.h" 7 #include "base/process_util.h"
8 #include "base/singleton.h" 8 #include "base/singleton.h"
9 #include "base/ref_counted.h" 9 #include "base/ref_counted.h"
10 #include "base/values.h" 10 #include "base/values.h"
11 #include "build/build_config.h" 11 #include "build/build_config.h"
12 #include "chrome/browser/browser_list.h" 12 #include "chrome/browser/browser_list.h"
13 #include "chrome/browser/browser_window.h" 13 #include "chrome/browser/browser_window.h"
14 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" 14 #include "chrome/browser/dom_ui/chrome_url_data_manager.h"
15 #include "chrome/browser/dom_ui/dom_ui_favicon_source.h" 15 #include "chrome/browser/dom_ui/dom_ui_favicon_source.h"
16 #include "chrome/browser/external_protocol_handler.h"
16 #include "chrome/browser/extensions/execute_code_in_tab_function.h" 17 #include "chrome/browser/extensions/execute_code_in_tab_function.h"
17 #include "chrome/browser/extensions/extension_accessibility_api.h" 18 #include "chrome/browser/extensions/extension_accessibility_api.h"
18 #include "chrome/browser/extensions/extension_bookmark_manager_api.h" 19 #include "chrome/browser/extensions/extension_bookmark_manager_api.h"
19 #include "chrome/browser/extensions/extension_bookmarks_module.h" 20 #include "chrome/browser/extensions/extension_bookmarks_module.h"
20 #include "chrome/browser/extensions/extension_bookmarks_module_constants.h" 21 #include "chrome/browser/extensions/extension_bookmarks_module_constants.h"
21 #include "chrome/browser/extensions/extension_browser_actions_api.h" 22 #include "chrome/browser/extensions/extension_browser_actions_api.h"
22 #include "chrome/browser/extensions/extension_clipboard_api.h" 23 #include "chrome/browser/extensions/extension_clipboard_api.h"
23 #include "chrome/browser/extensions/extension_context_menu_api.h" 24 #include "chrome/browser/extensions/extension_context_menu_api.h"
24 #include "chrome/browser/extensions/extension_cookies_api.h" 25 #include "chrome/browser/extensions/extension_cookies_api.h"
25 #include "chrome/browser/extensions/extension_dom_ui.h" 26 #include "chrome/browser/extensions/extension_dom_ui.h"
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 function->set_request_id(request_id); 406 function->set_request_id(request_id);
406 function->set_has_callback(has_callback); 407 function->set_has_callback(has_callback);
407 ExtensionsService* service = profile()->GetExtensionsService(); 408 ExtensionsService* service = profile()->GetExtensionsService();
408 DCHECK(service); 409 DCHECK(service);
409 Extension* extension = service->GetExtensionById(extension_id(), false); 410 Extension* extension = service->GetExtensionById(extension_id(), false);
410 DCHECK(extension); 411 DCHECK(extension);
411 function->set_include_incognito(service->IsIncognitoEnabled(extension)); 412 function->set_include_incognito(service->IsIncognitoEnabled(extension));
412 413
413 ExtensionsQuotaService* quota = service->quota_service(); 414 ExtensionsQuotaService* quota = service->quota_service();
414 if (quota->Assess(extension_id(), function, args, base::TimeTicks::Now())) { 415 if (quota->Assess(extension_id(), function, args, base::TimeTicks::Now())) {
416 // See crbug.com/39178.
417 ExternalProtocolHandler::PermitLaunchUrl();
418
415 function->Run(); 419 function->Run();
416 } else { 420 } else {
417 render_view_host_->SendExtensionResponse(function->request_id(), false, 421 render_view_host_->SendExtensionResponse(function->request_id(), false,
418 std::string(), QuotaLimitHeuristic::kGenericOverQuotaError); 422 std::string(), QuotaLimitHeuristic::kGenericOverQuotaError);
419 } 423 }
420 } 424 }
421 425
422 void ExtensionFunctionDispatcher::SendResponse(ExtensionFunction* function, 426 void ExtensionFunctionDispatcher::SendResponse(ExtensionFunction* function,
423 bool success) { 427 bool success) {
424 render_view_host_->SendExtensionResponse(function->request_id(), success, 428 render_view_host_->SendExtensionResponse(function->request_id(), success,
(...skipping 10 matching lines...) Expand all
435 } else { 439 } else {
436 NOTREACHED(); 440 NOTREACHED();
437 base::KillProcess(render_view_host_->process()->GetHandle(), 441 base::KillProcess(render_view_host_->process()->GetHandle(),
438 ResultCodes::KILLED_BAD_MESSAGE, false); 442 ResultCodes::KILLED_BAD_MESSAGE, false);
439 } 443 }
440 } 444 }
441 445
442 Profile* ExtensionFunctionDispatcher::profile() { 446 Profile* ExtensionFunctionDispatcher::profile() {
443 return profile_; 447 return profile_;
444 } 448 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/external_protocol_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698