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

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

Issue 48114: Reuse the eula terms from the chrome resources... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/first_run.cc » ('j') | chrome/browser/first_run.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/field_trial.h" 10 #include "base/field_trial.h"
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 262
263 // During first run we read the google_update registry key to find what 263 // During first run we read the google_update registry key to find what
264 // language the user selected when downloading the installer. This 264 // language the user selected when downloading the installer. This
265 // becomes our default language in the prefs. 265 // becomes our default language in the prefs.
266 if (is_first_run) { 266 if (is_first_run) {
267 std::wstring install_lang; 267 std::wstring install_lang;
268 if (GoogleUpdateSettings::GetLanguage(&install_lang)) 268 if (GoogleUpdateSettings::GetLanguage(&install_lang))
269 local_state->SetString(prefs::kApplicationLocale, install_lang); 269 local_state->SetString(prefs::kApplicationLocale, install_lang);
270 if (GoogleUpdateSettings::GetCollectStatsConsent()) 270 if (GoogleUpdateSettings::GetCollectStatsConsent())
271 local_state->SetBoolean(prefs::kMetricsReportingEnabled, true); 271 local_state->SetBoolean(prefs::kMetricsReportingEnabled, true);
272 // On first run, we need to process the master preferences before the
273 // browser's profile_manager object is created.
274 first_run_ui_bypass =
275 !FirstRun::ProcessMasterPreferences(user_data_dir, FilePath(), NULL);
276
277 // If we are running in App mode, we do not want to show the importer
278 // (first run) UI.
279 if (!first_run_ui_bypass && parsed_command_line.HasSwitch(switches::kApp))
280 first_run_ui_bypass = true;
281 } 272 }
282 273
283 // If the local state file for the current profile doesn't exist and the 274 // If the local state file for the current profile doesn't exist and the
284 // parent profile command line flag is present, then we should inherit some 275 // parent profile command line flag is present, then we should inherit some
285 // local state from the parent profile. 276 // local state from the parent profile.
286 // Checking that the local state file for the current profile doesn't exist 277 // Checking that the local state file for the current profile doesn't exist
287 // is the most robust way to determine whether we need to inherit or not 278 // is the most robust way to determine whether we need to inherit or not
288 // since the parent profile command line flag can be present even when the 279 // since the parent profile command line flag can be present even when the
289 // current profile is not a new one, and in that case we do not want to 280 // current profile is not a new one, and in that case we do not want to
290 // inherit and reset the user's setting. 281 // inherit and reset the user's setting.
(...skipping 12 matching lines...) Expand all
303 294
304 // If we're running tests (ui_task is non-null), then the ResourceBundle 295 // If we're running tests (ui_task is non-null), then the ResourceBundle
305 // has already been initialized. 296 // has already been initialized.
306 if (!parameters.ui_task) { 297 if (!parameters.ui_task) {
307 ResourceBundle::InitSharedInstance( 298 ResourceBundle::InitSharedInstance(
308 local_state->GetString(prefs::kApplicationLocale)); 299 local_state->GetString(prefs::kApplicationLocale));
309 // We only load the theme dll in the browser process. 300 // We only load the theme dll in the browser process.
310 ResourceBundle::GetSharedInstance().LoadThemeResources(); 301 ResourceBundle::GetSharedInstance().LoadThemeResources();
311 } 302 }
312 303
304 if (is_first_run) {
305 // On first run, we need to process the master preferences before the
306 // browser's profile_manager object is created, but after ResourceBundle
307 // is initialized.
308 first_run_ui_bypass =
309 !FirstRun::ProcessMasterPreferences(user_data_dir, FilePath(), NULL);
310
311 // If we are running in App mode, we do not want to show the importer
312 // (first run) UI.
313 if (!first_run_ui_bypass && parsed_command_line.HasSwitch(switches::kApp))
314 first_run_ui_bypass = true;
315 }
316
313 if (!parsed_command_line.HasSwitch(switches::kNoErrorDialogs)) { 317 if (!parsed_command_line.HasSwitch(switches::kNoErrorDialogs)) {
314 // Display a warning if the user is running windows 2000. 318 // Display a warning if the user is running windows 2000.
315 // TODO(port). We should probably change this to a "check for minimum 319 // TODO(port). We should probably change this to a "check for minimum
316 // requirements" function, implemented by each platform. 320 // requirements" function, implemented by each platform.
317 CheckForWin2000(); 321 CheckForWin2000();
318 } 322 }
319 323
320 // Initialize histogram statistics gathering system. 324 // Initialize histogram statistics gathering system.
321 StatisticsRecorder statistics; 325 StatisticsRecorder statistics;
322 326
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 if (metrics) 566 if (metrics)
563 metrics->Stop(); 567 metrics->Stop();
564 568
565 // browser_shutdown takes care of deleting browser_process, so we need to 569 // browser_shutdown takes care of deleting browser_process, so we need to
566 // release it. 570 // release it.
567 browser_process.release(); 571 browser_process.release();
568 browser_shutdown::Shutdown(); 572 browser_shutdown::Shutdown();
569 573
570 return result_code; 574 return result_code;
571 } 575 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/first_run.cc » ('j') | chrome/browser/first_run.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698