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

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

Issue 159539: Refactoring of master preferences parsing before adding a new preference. (Closed)
Patch Set: rename variable Created 11 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/first_run.h » ('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) 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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 Upgrade::TryResult answer = Upgrade::ShowTryChromeDialog(); 438 Upgrade::TryResult answer = Upgrade::ShowTryChromeDialog();
439 if (answer == Upgrade::TD_NOT_NOW) 439 if (answer == Upgrade::TD_NOT_NOW)
440 return ResultCodes::NORMAL_EXIT_EXP1; 440 return ResultCodes::NORMAL_EXIT_EXP1;
441 if (answer == Upgrade::TD_UNINSTALL_CHROME) 441 if (answer == Upgrade::TD_UNINSTALL_CHROME)
442 return ResultCodes::NORMAL_EXIT_EXP2; 442 return ResultCodes::NORMAL_EXIT_EXP2;
443 } 443 }
444 #endif // OS_WIN 444 #endif // OS_WIN
445 445
446 BrowserInit browser_init; 446 BrowserInit browser_init;
447 447
448 int rlz_ping_delay = 0;
448 if (is_first_run) { 449 if (is_first_run) {
449 // On first run, we need to process the master preferences before the 450 // On first run, we need to process the master preferences before the
450 // browser's profile_manager object is created, but after ResourceBundle 451 // browser's profile_manager object is created, but after ResourceBundle
451 // is initialized. 452 // is initialized.
452 std::vector<std::wstring> first_run_tabs; 453 std::vector<std::wstring> first_run_tabs;
453 first_run_ui_bypass = 454 first_run_ui_bypass = !FirstRun::ProcessMasterPreferences(user_data_dir,
454 !FirstRun::ProcessMasterPreferences(user_data_dir, FilePath(), NULL, 455 FilePath(),
455 &first_run_tabs); 456 &first_run_tabs,
457 &rlz_ping_delay);
456 // The master prefs might specify a set of urls to display. 458 // The master prefs might specify a set of urls to display.
457 if (first_run_tabs.size()) 459 if (first_run_tabs.size())
458 AddFirstRunNewTabs(&browser_init, first_run_tabs); 460 AddFirstRunNewTabs(&browser_init, first_run_tabs);
459 461
460 // If we are running in App mode, we do not want to show the importer 462 // If we are running in App mode, we do not want to show the importer
461 // (first run) UI. 463 // (first run) UI.
462 if (!first_run_ui_bypass && 464 if (!first_run_ui_bypass &&
463 (parsed_command_line.HasSwitch(switches::kApp) || 465 (parsed_command_line.HasSwitch(switches::kApp) ||
464 parsed_command_line.HasSwitch(switches::kNoFirstRun))) { 466 parsed_command_line.HasSwitch(switches::kNoFirstRun))) {
465 first_run_ui_bypass = true; 467 first_run_ui_bypass = true;
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 653
652 #if defined(OS_WIN) 654 #if defined(OS_WIN)
653 // Init common control sex. 655 // Init common control sex.
654 INITCOMMONCONTROLSEX config; 656 INITCOMMONCONTROLSEX config;
655 config.dwSize = sizeof(config); 657 config.dwSize = sizeof(config);
656 config.dwICC = ICC_WIN95_CLASSES; 658 config.dwICC = ICC_WIN95_CLASSES;
657 InitCommonControlsEx(&config); 659 InitCommonControlsEx(&config);
658 660
659 win_util::ScopedCOMInitializer com_initializer; 661 win_util::ScopedCOMInitializer com_initializer;
660 662
661 int delay = 0;
662 installer_util::GetDistributionPingDelay(FilePath(), delay);
663 // Init the RLZ library. This just binds the dll and schedules a task on the 663 // Init the RLZ library. This just binds the dll and schedules a task on the
664 // file thread to be run sometime later. If this is the first run we record 664 // file thread to be run sometime later. If this is the first run we record
665 // the installation event. 665 // the installation event.
666 RLZTracker::InitRlzDelayed(base::DIR_MODULE, is_first_run, delay); 666 RLZTracker::InitRlzDelayed(base::DIR_MODULE, is_first_run, rlz_ping_delay);
667 #endif 667 #endif
668 668
669 // Config the network module so it has access to resources. 669 // Config the network module so it has access to resources.
670 net::NetModule::SetResourceProvider(NetResourceProvider); 670 net::NetModule::SetResourceProvider(NetResourceProvider);
671 671
672 // Register our global network handler for chrome:// and 672 // Register our global network handler for chrome:// and
673 // chrome-extension:// URLs. 673 // chrome-extension:// URLs.
674 RegisterURLRequestChromeJob(); 674 RegisterURLRequestChromeJob();
675 RegisterExtensionProtocols(); 675 RegisterExtensionProtocols();
676 RegisterMetadataURLRequestHandler(); 676 RegisterMetadataURLRequestHandler();
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 if (metrics) 793 if (metrics)
794 metrics->Stop(); 794 metrics->Stop();
795 795
796 // browser_shutdown takes care of deleting browser_process, so we need to 796 // browser_shutdown takes care of deleting browser_process, so we need to
797 // release it. 797 // release it.
798 browser_process.release(); 798 browser_process.release();
799 browser_shutdown::Shutdown(); 799 browser_shutdown::Shutdown();
800 800
801 return result_code; 801 return result_code;
802 } 802 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/first_run.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698