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

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

Issue 7885013: Move the ViewHostMsg_ClearPredictorCache out of content into chrome as this functionality is chro... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/app/breakpad_mac.h" 8 #include "chrome/app/breakpad_mac.h"
9 #include "chrome/browser/browser_about_handler.h" 9 #include "chrome/browser/browser_about_handler.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
11 #include "chrome/browser/browsing_data_remover.h" 11 #include "chrome/browser/browsing_data_remover.h"
12 #include "chrome/browser/character_encoding.h" 12 #include "chrome/browser/character_encoding.h"
13 #include "chrome/browser/chrome_benchmarking_message_filter.h"
13 #include "chrome/browser/chrome_plugin_message_filter.h" 14 #include "chrome/browser/chrome_plugin_message_filter.h"
14 #include "chrome/browser/chrome_quota_permission_context.h" 15 #include "chrome/browser/chrome_quota_permission_context.h"
15 #include "chrome/browser/chrome_worker_message_filter.h" 16 #include "chrome/browser/chrome_worker_message_filter.h"
16 #include "chrome/browser/content_settings/host_content_settings_map.h" 17 #include "chrome/browser/content_settings/host_content_settings_map.h"
17 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 18 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
18 #include "chrome/browser/download/download_util.h" 19 #include "chrome/browser/download/download_util.h"
19 #include "chrome/browser/extensions/extension_info_map.h" 20 #include "chrome/browser/extensions/extension_info_map.h"
20 #include "chrome/browser/extensions/extension_message_handler.h" 21 #include "chrome/browser/extensions/extension_message_handler.h"
21 #include "chrome/browser/extensions/extension_service.h" 22 #include "chrome/browser/extensions/extension_service.h"
22 #include "chrome/browser/extensions/extension_web_ui.h" 23 #include "chrome/browser/extensions/extension_web_ui.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 void ChromeContentBrowserClient::BrowserRenderProcessHostCreated( 162 void ChromeContentBrowserClient::BrowserRenderProcessHostCreated(
162 BrowserRenderProcessHost* host) { 163 BrowserRenderProcessHost* host) {
163 int id = host->id(); 164 int id = host->id();
164 Profile* profile = Profile::FromBrowserContext(host->browser_context()); 165 Profile* profile = Profile::FromBrowserContext(host->browser_context());
165 host->channel()->AddFilter(new ChromeRenderMessageFilter( 166 host->channel()->AddFilter(new ChromeRenderMessageFilter(
166 id, profile, profile->GetRequestContextForRenderProcess(id))); 167 id, profile, profile->GetRequestContextForRenderProcess(id)));
167 host->channel()->AddFilter(new PrintingMessageFilter()); 168 host->channel()->AddFilter(new PrintingMessageFilter());
168 host->channel()->AddFilter( 169 host->channel()->AddFilter(
169 new SearchProviderInstallStateMessageFilter(id, profile)); 170 new SearchProviderInstallStateMessageFilter(id, profile));
170 host->channel()->AddFilter(new SpellCheckMessageFilter(id)); 171 host->channel()->AddFilter(new SpellCheckMessageFilter(id));
172 host->channel()->AddFilter(new ChromeBenchmarkingMessageFilter(
173 id, profile, profile->GetRequestContextForRenderProcess(id)));
171 174
172 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( 175 host->Send(new ChromeViewMsg_SetIsIncognitoProcess(
173 profile->IsOffTheRecord())); 176 profile->IsOffTheRecord()));
174 } 177 }
175 178
176 void ChromeContentBrowserClient::PluginProcessHostCreated( 179 void ChromeContentBrowserClient::PluginProcessHostCreated(
177 PluginProcessHost* host) { 180 PluginProcessHost* host) {
178 host->AddFilter(new ChromePluginMessageFilter(host)); 181 host->AddFilter(new ChromePluginMessageFilter(host));
179 } 182 }
180 183
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 switches::kMemoryProfiling, 328 switches::kMemoryProfiling,
326 switches::kMessageLoopHistogrammer, 329 switches::kMessageLoopHistogrammer,
327 switches::kPpapiFlashArgs, 330 switches::kPpapiFlashArgs,
328 switches::kPpapiFlashInProcess, 331 switches::kPpapiFlashInProcess,
329 switches::kPpapiFlashPath, 332 switches::kPpapiFlashPath,
330 switches::kPpapiFlashVersion, 333 switches::kPpapiFlashVersion,
331 switches::kProfilingAtStart, 334 switches::kProfilingAtStart,
332 switches::kProfilingFile, 335 switches::kProfilingFile,
333 switches::kProfilingFlush, 336 switches::kProfilingFlush,
334 switches::kSilentDumpOnDCHECK, 337 switches::kSilentDumpOnDCHECK,
338 switches::kEnableBenchmarking,
335 }; 339 };
336 340
337 command_line->CopySwitchesFrom(browser_command_line, kSwitchNames, 341 command_line->CopySwitchesFrom(browser_command_line, kSwitchNames,
338 arraysize(kSwitchNames)); 342 arraysize(kSwitchNames));
339 } else if (process_type == switches::kUtilityProcess) { 343 } else if (process_type == switches::kUtilityProcess) {
340 if (browser_command_line.HasSwitch( 344 if (browser_command_line.HasSwitch(
341 switches::kEnableExperimentalExtensionApis)) { 345 switches::kEnableExperimentalExtensionApis)) {
342 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); 346 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis);
343 } 347 }
344 } else if (process_type == switches::kPluginProcess) { 348 } else if (process_type == switches::kPluginProcess) {
(...skipping 13 matching lines...) Expand all
358 switches::kUserDataDir, // Make logs go to the right file. 362 switches::kUserDataDir, // Make logs go to the right file.
359 // Load (in-process) Pepper plugins in-process in the zygote pre-sandbox. 363 // Load (in-process) Pepper plugins in-process in the zygote pre-sandbox.
360 switches::kPpapiFlashInProcess, 364 switches::kPpapiFlashInProcess,
361 switches::kPpapiFlashPath, 365 switches::kPpapiFlashPath,
362 switches::kPpapiFlashVersion, 366 switches::kPpapiFlashVersion,
363 }; 367 };
364 368
365 command_line->CopySwitchesFrom(browser_command_line, kSwitchNames, 369 command_line->CopySwitchesFrom(browser_command_line, kSwitchNames,
366 arraysize(kSwitchNames)); 370 arraysize(kSwitchNames));
367 } 371 }
372
373 // The command line switch kEnableBenchmarking needs to be specified along
374 // with the kEnableStatsTable switch to ensure that the stats table global
375 // is initialized correctly.
376 if (command_line->HasSwitch(switches::kEnableBenchmarking))
377 DCHECK(command_line->HasSwitch(switches::kEnableStatsTable));
368 } 378 }
369 379
370 std::string ChromeContentBrowserClient::GetApplicationLocale() { 380 std::string ChromeContentBrowserClient::GetApplicationLocale() {
371 return g_browser_process->GetApplicationLocale(); 381 return g_browser_process->GetApplicationLocale();
372 } 382 }
373 383
374 std::string ChromeContentBrowserClient::GetAcceptLangs(const TabContents* tab) { 384 std::string ChromeContentBrowserClient::GetAcceptLangs(const TabContents* tab) {
375 Profile* profile = Profile::FromBrowserContext(tab->browser_context()); 385 Profile* profile = Profile::FromBrowserContext(tab->browser_context());
376 return profile->GetPrefs()->GetString(prefs::kAcceptLanguages); 386 return profile->GetPrefs()->GetString(prefs::kAcceptLanguages);
377 } 387 }
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 #if defined(USE_NSS) 814 #if defined(USE_NSS)
805 crypto::CryptoModuleBlockingPasswordDelegate* 815 crypto::CryptoModuleBlockingPasswordDelegate*
806 ChromeContentBrowserClient::GetCryptoPasswordDelegate( 816 ChromeContentBrowserClient::GetCryptoPasswordDelegate(
807 const GURL& url) { 817 const GURL& url) {
808 return browser::NewCryptoModuleBlockingDialogDelegate( 818 return browser::NewCryptoModuleBlockingDialogDelegate(
809 browser::kCryptoModulePasswordKeygen, url.host()); 819 browser::kCryptoModulePasswordKeygen, url.host());
810 } 820 }
811 #endif 821 #endif
812 822
813 } // namespace chrome 823 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/chrome_benchmarking_message_filter.cc ('k') | chrome/browser/renderer_host/chrome_render_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698