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

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

Issue 165382: Merge 22284 - Refactoring of master preferences parsing before adding a new p... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: 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 | Annotate | Revision Log
« 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')
Property Changes:
Modified: svn:mergeinfo
Merged /trunk/src/chrome/browser/browser_main.cc:r22284
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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 Upgrade::TryResult answer = Upgrade::ShowTryChromeDialog(); 435 Upgrade::TryResult answer = Upgrade::ShowTryChromeDialog();
436 if (answer == Upgrade::TD_NOT_NOW) 436 if (answer == Upgrade::TD_NOT_NOW)
437 return ResultCodes::NORMAL_EXIT_EXP1; 437 return ResultCodes::NORMAL_EXIT_EXP1;
438 if (answer == Upgrade::TD_UNINSTALL_CHROME) 438 if (answer == Upgrade::TD_UNINSTALL_CHROME)
439 return ResultCodes::NORMAL_EXIT_EXP2; 439 return ResultCodes::NORMAL_EXIT_EXP2;
440 } 440 }
441 #endif // OS_WIN 441 #endif // OS_WIN
442 442
443 BrowserInit browser_init; 443 BrowserInit browser_init;
444 444
445 int rlz_ping_delay = 0;
445 if (is_first_run) { 446 if (is_first_run) {
446 // On first run, we need to process the master preferences before the 447 // On first run, we need to process the master preferences before the
447 // browser's profile_manager object is created, but after ResourceBundle 448 // browser's profile_manager object is created, but after ResourceBundle
448 // is initialized. 449 // is initialized.
449 std::vector<std::wstring> first_run_tabs; 450 std::vector<std::wstring> first_run_tabs;
450 first_run_ui_bypass = 451 first_run_ui_bypass = !FirstRun::ProcessMasterPreferences(user_data_dir,
451 !FirstRun::ProcessMasterPreferences(user_data_dir, FilePath(), NULL, 452 FilePath(),
452 &first_run_tabs); 453 &first_run_tabs,
454 &rlz_ping_delay);
453 // The master prefs might specify a set of urls to display. 455 // The master prefs might specify a set of urls to display.
454 if (first_run_tabs.size()) 456 if (first_run_tabs.size())
455 AddFirstRunNewTabs(&browser_init, first_run_tabs); 457 AddFirstRunNewTabs(&browser_init, first_run_tabs);
456 458
457 // If we are running in App mode, we do not want to show the importer 459 // If we are running in App mode, we do not want to show the importer
458 // (first run) UI. 460 // (first run) UI.
459 if (!first_run_ui_bypass && 461 if (!first_run_ui_bypass &&
460 (parsed_command_line.HasSwitch(switches::kApp) || 462 (parsed_command_line.HasSwitch(switches::kApp) ||
461 parsed_command_line.HasSwitch(switches::kNoFirstRun))) { 463 parsed_command_line.HasSwitch(switches::kNoFirstRun))) {
462 first_run_ui_bypass = true; 464 first_run_ui_bypass = true;
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 633
632 #if defined(OS_WIN) 634 #if defined(OS_WIN)
633 // Init common control sex. 635 // Init common control sex.
634 INITCOMMONCONTROLSEX config; 636 INITCOMMONCONTROLSEX config;
635 config.dwSize = sizeof(config); 637 config.dwSize = sizeof(config);
636 config.dwICC = ICC_WIN95_CLASSES; 638 config.dwICC = ICC_WIN95_CLASSES;
637 InitCommonControlsEx(&config); 639 InitCommonControlsEx(&config);
638 640
639 win_util::ScopedCOMInitializer com_initializer; 641 win_util::ScopedCOMInitializer com_initializer;
640 642
641 int delay = 0;
642 installer_util::GetDistributionPingDelay(FilePath(), delay);
643 // Init the RLZ library. This just binds the dll and schedules a task on the 643 // Init the RLZ library. This just binds the dll and schedules a task on the
644 // file thread to be run sometime later. If this is the first run we record 644 // file thread to be run sometime later. If this is the first run we record
645 // the installation event. 645 // the installation event.
646 RLZTracker::InitRlzDelayed(base::DIR_MODULE, is_first_run, delay); 646 RLZTracker::InitRlzDelayed(base::DIR_MODULE, is_first_run, rlz_ping_delay);
647 #endif 647 #endif
648 648
649 // Config the network module so it has access to resources. 649 // Config the network module so it has access to resources.
650 net::NetModule::SetResourceProvider(NetResourceProvider); 650 net::NetModule::SetResourceProvider(NetResourceProvider);
651 651
652 // Register our global network handler for chrome:// and 652 // Register our global network handler for chrome:// and
653 // chrome-extension:// URLs. 653 // chrome-extension:// URLs.
654 RegisterURLRequestChromeJob(); 654 RegisterURLRequestChromeJob();
655 RegisterExtensionProtocols(); 655 RegisterExtensionProtocols();
656 RegisterMetadataURLRequestHandler(); 656 RegisterMetadataURLRequestHandler();
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 if (metrics) 773 if (metrics)
774 metrics->Stop(); 774 metrics->Stop();
775 775
776 // browser_shutdown takes care of deleting browser_process, so we need to 776 // browser_shutdown takes care of deleting browser_process, so we need to
777 // release it. 777 // release it.
778 browser_process.release(); 778 browser_process.release();
779 browser_shutdown::Shutdown(); 779 browser_shutdown::Shutdown();
780 780
781 return result_code; 781 return result_code;
782 } 782 }
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