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

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 17165004: <webview>: Partially migrate loadcommit event from content to chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with ToT Created 7 years, 6 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
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/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/lazy_instance.h" 13 #include "base/lazy_instance.h"
14 #include "base/path_service.h" 14 #include "base/path_service.h"
15 #include "base/prefs/pref_service.h" 15 #include "base/prefs/pref_service.h"
16 #include "base/strings/string_number_conversions.h" 16 #include "base/strings/string_number_conversions.h"
17 #include "base/strings/utf_string_conversions.h" 17 #include "base/strings/utf_string_conversions.h"
18 #include "base/threading/sequenced_worker_pool.h" 18 #include "base/threading/sequenced_worker_pool.h"
19 #include "chrome/app/breakpad_mac.h" 19 #include "chrome/app/breakpad_mac.h"
20 #include "chrome/browser/adview/adview_guest.h"
20 #include "chrome/browser/app_mode/app_mode_utils.h" 21 #include "chrome/browser/app_mode/app_mode_utils.h"
21 #include "chrome/browser/browser_about_handler.h" 22 #include "chrome/browser/browser_about_handler.h"
22 #include "chrome/browser/browser_process.h" 23 #include "chrome/browser/browser_process.h"
23 #include "chrome/browser/browsing_data/browsing_data_helper.h" 24 #include "chrome/browser/browsing_data/browsing_data_helper.h"
24 #include "chrome/browser/browsing_data/browsing_data_remover.h" 25 #include "chrome/browser/browsing_data/browsing_data_remover.h"
25 #include "chrome/browser/character_encoding.h" 26 #include "chrome/browser/character_encoding.h"
26 #include "chrome/browser/chrome_net_benchmarking_message_filter.h" 27 #include "chrome/browser/chrome_net_benchmarking_message_filter.h"
27 #include "chrome/browser/chrome_quota_permission_context.h" 28 #include "chrome/browser/chrome_quota_permission_context.h"
28 #include "chrome/browser/content_settings/content_settings_utils.h" 29 #include "chrome/browser/content_settings/content_settings_utils.h"
29 #include "chrome/browser/content_settings/cookie_settings.h" 30 #include "chrome/browser/content_settings/cookie_settings.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 #include "chrome/browser/ssl/ssl_tab_helper.h" 78 #include "chrome/browser/ssl/ssl_tab_helper.h"
78 #include "chrome/browser/tab_contents/tab_util.h" 79 #include "chrome/browser/tab_contents/tab_util.h"
79 #include "chrome/browser/toolkit_extra_parts.h" 80 #include "chrome/browser/toolkit_extra_parts.h"
80 #include "chrome/browser/ui/chrome_select_file_policy.h" 81 #include "chrome/browser/ui/chrome_select_file_policy.h"
81 #include "chrome/browser/ui/sync/sync_promo_ui.h" 82 #include "chrome/browser/ui/sync/sync_promo_ui.h"
82 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" 83 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h"
83 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" 84 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h"
84 #include "chrome/browser/user_style_sheet_watcher.h" 85 #include "chrome/browser/user_style_sheet_watcher.h"
85 #include "chrome/browser/user_style_sheet_watcher_factory.h" 86 #include "chrome/browser/user_style_sheet_watcher_factory.h"
86 #include "chrome/browser/validation_message_message_filter.h" 87 #include "chrome/browser/validation_message_message_filter.h"
88 #include "chrome/browser/webview/webview_constants.h"
87 #include "chrome/browser/webview/webview_guest.h" 89 #include "chrome/browser/webview/webview_guest.h"
88 #include "chrome/common/child_process_logging.h" 90 #include "chrome/common/child_process_logging.h"
89 #include "chrome/common/chrome_constants.h" 91 #include "chrome/common/chrome_constants.h"
90 #include "chrome/common/chrome_paths.h" 92 #include "chrome/common/chrome_paths.h"
91 #include "chrome/common/chrome_process_type.h" 93 #include "chrome/common/chrome_process_type.h"
92 #include "chrome/common/chrome_switches.h" 94 #include "chrome/common/chrome_switches.h"
93 #include "chrome/common/extensions/background_info.h" 95 #include "chrome/common/extensions/background_info.h"
94 #include "chrome/common/extensions/extension.h" 96 #include "chrome/common/extensions/extension.h"
95 #include "chrome/common/extensions/extension_process_policy.h" 97 #include "chrome/common/extensions/extension_process_policy.h"
96 #include "chrome/common/extensions/extension_set.h" 98 #include "chrome/common/extensions/extension_set.h"
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 if (!service) 708 if (!service)
707 return; 709 return;
708 const GURL& url = embedder_web_contents->GetSiteInstance()->GetSiteURL(); 710 const GURL& url = embedder_web_contents->GetSiteInstance()->GetSiteURL();
709 const Extension* extension = service->extensions()-> 711 const Extension* extension = service->extensions()->
710 GetExtensionOrAppByURL(ExtensionURLInfo(url)); 712 GetExtensionOrAppByURL(ExtensionURLInfo(url));
711 if (!extension) 713 if (!extension)
712 return; 714 return;
713 std::vector<ExtensionMsg_Loaded_Params> extensions; 715 std::vector<ExtensionMsg_Loaded_Params> extensions;
714 extensions.push_back(ExtensionMsg_Loaded_Params(extension)); 716 extensions.push_back(ExtensionMsg_Loaded_Params(extension));
715 guest_web_contents->Send(new ExtensionMsg_Loaded(extensions)); 717 guest_web_contents->Send(new ExtensionMsg_Loaded(extensions));
716 new WebViewGuest(guest_web_contents, 718
717 embedder_web_contents, 719 std::string api_type;
718 extension->id(), 720 extra_params.GetString(webview_constants::kAttributeApi, &api_type);
719 browser_plugin_instance_id, 721
720 extra_params); 722 if (api_type == "adview") {
723 new AdViewGuest(guest_web_contents,
sky 2013/06/25 16:16:52 Document AdViewGuest/WebViewGuest delete themselve
Fady Samuel 2013/06/25 16:54:42 Done.
724 embedder_web_contents,
725 extension->id(),
726 browser_plugin_instance_id,
727 extra_params);
728 } else if (api_type == "webview") {
729 new WebViewGuest(guest_web_contents,
730 embedder_web_contents,
731 extension->id(),
732 browser_plugin_instance_id,
733 extra_params);
734 } else {
735 NOTREACHED();
736 }
721 } 737 }
722 738
723 void ChromeContentBrowserClient::RenderProcessHostCreated( 739 void ChromeContentBrowserClient::RenderProcessHostCreated(
724 content::RenderProcessHost* host) { 740 content::RenderProcessHost* host) {
725 int id = host->GetID(); 741 int id = host->GetID();
726 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); 742 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext());
727 net::URLRequestContextGetter* context = 743 net::URLRequestContextGetter* context =
728 profile->GetRequestContextForRenderProcess(id); 744 profile->GetRequestContextForRenderProcess(id);
729 745
730 host->GetChannel()->AddFilter(new ChromeRenderMessageFilter( 746 host->GetChannel()->AddFilter(new ChromeRenderMessageFilter(
(...skipping 1618 matching lines...) Expand 10 before | Expand all | Expand 10 after
2349 #if defined(USE_NSS) 2365 #if defined(USE_NSS)
2350 crypto::CryptoModuleBlockingPasswordDelegate* 2366 crypto::CryptoModuleBlockingPasswordDelegate*
2351 ChromeContentBrowserClient::GetCryptoPasswordDelegate( 2367 ChromeContentBrowserClient::GetCryptoPasswordDelegate(
2352 const GURL& url) { 2368 const GURL& url) {
2353 return chrome::NewCryptoModuleBlockingDialogDelegate( 2369 return chrome::NewCryptoModuleBlockingDialogDelegate(
2354 chrome::kCryptoModulePasswordKeygen, url.host()); 2370 chrome::kCryptoModulePasswordKeygen, url.host());
2355 } 2371 }
2356 #endif 2372 #endif
2357 2373
2358 } // namespace chrome 2374 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698