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

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

Issue 115890: Initialize gtk syles before first run dialog. (Missed in r17104) (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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 "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 // locale dll to load. 322 // locale dll to load.
323 PrefService* local_state = browser_process->local_state(); 323 PrefService* local_state = browser_process->local_state();
324 DCHECK(local_state); 324 DCHECK(local_state);
325 325
326 // Initialize ResourceBundle which handles files loaded from external 326 // Initialize ResourceBundle which handles files loaded from external
327 // sources. This has to be done before uninstall code path and before prefs 327 // sources. This has to be done before uninstall code path and before prefs
328 // are registered. 328 // are registered.
329 local_state->RegisterStringPref(prefs::kApplicationLocale, L""); 329 local_state->RegisterStringPref(prefs::kApplicationLocale, L"");
330 local_state->RegisterBooleanPref(prefs::kMetricsReportingEnabled, false); 330 local_state->RegisterBooleanPref(prefs::kMetricsReportingEnabled, false);
331 331
332 #if defined(TOOLKIT_GTK)
333 // It is important for this to happen before the first run dialog, as it
334 // styles the dialog as well.
335 gtk_util::InitRCStyles();
336 #endif
337
332 #if defined(OS_POSIX) 338 #if defined(OS_POSIX)
333 // On Mac OS X / Linux we display the first run dialog as early as possible, 339 // On Mac OS X / Linux we display the first run dialog as early as possible,
334 // so we can get the stats enabled. 340 // so we can get the stats enabled.
335 // TODO(port): 341 // TODO(port):
336 // We check the kNoFirstRun command line switch explicitly here since the 342 // We check the kNoFirstRun command line switch explicitly here since the
337 // early placement of this block happens before that's factored into 343 // early placement of this block happens before that's factored into
338 // first_run_ui_bypass, we probably want to move that block up 344 // first_run_ui_bypass, we probably want to move that block up
339 // and remove the explicit check from here in the long run. 345 // and remove the explicit check from here in the long run.
340 if (is_first_run && !first_run_ui_bypass && 346 if (is_first_run && !first_run_ui_bypass &&
341 !parsed_command_line.HasSwitch(switches::kNoFirstRun)) { 347 !parsed_command_line.HasSwitch(switches::kNoFirstRun)) {
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 // allow the user level Chrome to run. So we notify the user and uninstall 529 // allow the user level Chrome to run. So we notify the user and uninstall
524 // user level Chrome. 530 // user level Chrome.
525 // Note this check should only happen here, after all the checks above 531 // Note this check should only happen here, after all the checks above
526 // (uninstall, resource bundle initialization, other chrome browser 532 // (uninstall, resource bundle initialization, other chrome browser
527 // processes etc). 533 // processes etc).
528 if (CheckMachineLevelInstall()) 534 if (CheckMachineLevelInstall())
529 return ResultCodes::MACHINE_LEVEL_INSTALL_EXISTS; 535 return ResultCodes::MACHINE_LEVEL_INSTALL_EXISTS;
530 536
531 process_singleton.Create(); 537 process_singleton.Create();
532 538
533 #if defined(TOOLKIT_GTK)
534 // It is important for this to happen before the first run dialog, as it
535 // styles the dialog as well.
536 gtk_util::InitRCStyles();
537 #endif
538
539 // TODO(port): This block of code should probably be used on all platforms! 539 // TODO(port): This block of code should probably be used on all platforms!
540 // On Mac OS X / Linux we display this dialog before setting the value of 540 // On Mac OS X / Linux we display this dialog before setting the value of
541 // kMetricsReportingEnabled, so we display this dialog much earlier. 541 // kMetricsReportingEnabled, so we display this dialog much earlier.
542 // On Windows a download is tagged with stats enabled/disabled so the UI 542 // On Windows a download is tagged with stats enabled/disabled so the UI
543 // can be displayed later in the startup process. 543 // can be displayed later in the startup process.
544 #if !defined(OS_POSIX) 544 #if !defined(OS_POSIX)
545 // Show the First Run UI if this is the first time Chrome has been run on 545 // Show the First Run UI if this is the first time Chrome has been run on
546 // this computer, or we're being compelled to do so by a command line flag. 546 // this computer, or we're being compelled to do so by a command line flag.
547 // Note that this be done _after_ the PrefService is initialized and all 547 // Note that this be done _after_ the PrefService is initialized and all
548 // preferences are registered, since some of the code that the importer 548 // preferences are registered, since some of the code that the importer
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 if (metrics) 725 if (metrics)
726 metrics->Stop(); 726 metrics->Stop();
727 727
728 // browser_shutdown takes care of deleting browser_process, so we need to 728 // browser_shutdown takes care of deleting browser_process, so we need to
729 // release it. 729 // release it.
730 browser_process.release(); 730 browser_process.release();
731 browser_shutdown::Shutdown(); 731 browser_shutdown::Shutdown();
732 732
733 return result_code; 733 return result_code;
734 } 734 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698