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

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

Issue 2531133002: Convert SetIsIncognitoProcess to use mojo. (Closed)
Patch Set: Convert SetIsIncognitoProcess to use mojo. Created 4 years 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/common/BUILD.gn » ('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) 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 <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 #include "chrome/common/chrome_constants.h" 102 #include "chrome/common/chrome_constants.h"
103 #include "chrome/common/chrome_paths.h" 103 #include "chrome/common/chrome_paths.h"
104 #include "chrome/common/chrome_switches.h" 104 #include "chrome/common/chrome_switches.h"
105 #include "chrome/common/env_vars.h" 105 #include "chrome/common/env_vars.h"
106 #include "chrome/common/features.h" 106 #include "chrome/common/features.h"
107 #include "chrome/common/logging_chrome.h" 107 #include "chrome/common/logging_chrome.h"
108 #include "chrome/common/origin_trials/chrome_origin_trial_policy.h" 108 #include "chrome/common/origin_trials/chrome_origin_trial_policy.h"
109 #include "chrome/common/pepper_permission_util.h" 109 #include "chrome/common/pepper_permission_util.h"
110 #include "chrome/common/pref_names.h" 110 #include "chrome/common/pref_names.h"
111 #include "chrome/common/render_messages.h" 111 #include "chrome/common/render_messages.h"
112 #include "chrome/common/renderer_configuration.mojom.h"
112 #include "chrome/common/secure_origin_whitelist.h" 113 #include "chrome/common/secure_origin_whitelist.h"
113 #include "chrome/common/stack_sampling_configuration.h" 114 #include "chrome/common/stack_sampling_configuration.h"
114 #include "chrome/common/url_constants.h" 115 #include "chrome/common/url_constants.h"
115 #include "chrome/grit/browser_resources.h" 116 #include "chrome/grit/browser_resources.h"
116 #include "chrome/grit/generated_resources.h" 117 #include "chrome/grit/generated_resources.h"
117 #include "chrome/installer/util/google_update_settings.h" 118 #include "chrome/installer/util/google_update_settings.h"
118 #include "chromeos/chromeos_constants.h" 119 #include "chromeos/chromeos_constants.h"
119 #include "components/autofill/content/browser/content_autofill_driver_factory.h" 120 #include "components/autofill/content/browser/content_autofill_driver_factory.h"
120 #include "components/autofill/core/common/autofill_switches.h" 121 #include "components/autofill/core/common/autofill_switches.h"
121 #include "components/cdm/browser/cdm_message_filter_android.h" 122 #include "components/cdm/browser/cdm_message_filter_android.h"
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 #if !defined(DISABLE_NACL) 1076 #if !defined(DISABLE_NACL)
1076 host->AddFilter(new nacl::NaClHostMessageFilter( 1077 host->AddFilter(new nacl::NaClHostMessageFilter(
1077 id, profile->IsOffTheRecord(), 1078 id, profile->IsOffTheRecord(),
1078 profile->GetPath(), 1079 profile->GetPath(),
1079 context)); 1080 context));
1080 #endif 1081 #endif
1081 #if defined(OS_ANDROID) 1082 #if defined(OS_ANDROID)
1082 host->AddFilter(new cdm::CdmMessageFilterAndroid()); 1083 host->AddFilter(new cdm::CdmMessageFilterAndroid());
1083 #endif 1084 #endif
1084 1085
1085 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( 1086 bool is_incognito_process = profile->IsOffTheRecord();
1086 profile->IsOffTheRecord())); 1087
1088 chrome::mojom::RendererConfigurationAssociatedPtr rc_interface;
1089 host->GetChannel()->GetRemoteAssociatedInterface(&rc_interface);
1090 rc_interface->SetInitialConfiguration(is_incognito_process);
1087 1091
1088 for (size_t i = 0; i < extra_parts_.size(); ++i) 1092 for (size_t i = 0; i < extra_parts_.size(); ++i)
1089 extra_parts_[i]->RenderProcessWillLaunch(host); 1093 extra_parts_[i]->RenderProcessWillLaunch(host);
1090 1094
1091 RendererContentSettingRules rules; 1095 RendererContentSettingRules rules;
1092 if (host->IsForGuestsOnly()) { 1096 if (host->IsForGuestsOnly()) {
1093 #if BUILDFLAG(ENABLE_EXTENSIONS) 1097 #if BUILDFLAG(ENABLE_EXTENSIONS)
1094 GetGuestViewDefaultContentSettingRules(profile->IsOffTheRecord(), &rules); 1098 GetGuestViewDefaultContentSettingRules(is_incognito_process, &rules);
1095 #else 1099 #else
1096 NOTREACHED(); 1100 NOTREACHED();
1097 #endif 1101 #endif
1098 } else { 1102 } else {
1099 GetRendererContentSettingRules( 1103 GetRendererContentSettingRules(
1100 HostContentSettingsMapFactory::GetForProfile(profile), &rules); 1104 HostContentSettingsMapFactory::GetForProfile(profile), &rules);
1101 } 1105 }
1106 // TODO(nigeltao): eliminate this legacy IPC. Instead, add an extra arg to
1107 // the rc_interface->SetInitialConfiguration call.
1102 host->Send(new ChromeViewMsg_SetContentSettingRules(rules)); 1108 host->Send(new ChromeViewMsg_SetContentSettingRules(rules));
1103 } 1109 }
1104 1110
1105 GURL ChromeContentBrowserClient::GetEffectiveURL( 1111 GURL ChromeContentBrowserClient::GetEffectiveURL(
1106 content::BrowserContext* browser_context, const GURL& url) { 1112 content::BrowserContext* browser_context, const GURL& url) {
1107 Profile* profile = Profile::FromBrowserContext(browser_context); 1113 Profile* profile = Profile::FromBrowserContext(browser_context);
1108 if (!profile) 1114 if (!profile)
1109 return url; 1115 return url;
1110 1116
1111 // If the input |url| should be assigned to the Instant renderer, make its 1117 // If the input |url| should be assigned to the Instant renderer, make its
(...skipping 2229 matching lines...) Expand 10 before | Expand all | Expand 10 after
3341 GetBrowserSchedulerWorkerPoolParamsFromVariations(); 3347 GetBrowserSchedulerWorkerPoolParamsFromVariations();
3342 *index_to_traits_callback = base::Bind(&task_scheduler_util::initialization:: 3348 *index_to_traits_callback = base::Bind(&task_scheduler_util::initialization::
3343 BrowserWorkerPoolIndexForTraits); 3349 BrowserWorkerPoolIndexForTraits);
3344 } 3350 }
3345 3351
3346 void ChromeContentBrowserClient:: 3352 void ChromeContentBrowserClient::
3347 PerformExperimentalTaskSchedulerRedirections() { 3353 PerformExperimentalTaskSchedulerRedirections() {
3348 task_scheduler_util::variations:: 3354 task_scheduler_util::variations::
3349 MaybePerformBrowserTaskSchedulerRedirection(); 3355 MaybePerformBrowserTaskSchedulerRedirection();
3350 } 3356 }
OLDNEW
« no previous file with comments | « no previous file | chrome/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698