OLD | NEW |
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/ui/browser_init.h" | 5 #include "chrome/browser/ui/browser_init.h" |
6 | 6 |
7 #include <algorithm> // For max(). | 7 #include <algorithm> // For max(). |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/environment.h" | 10 #include "base/environment.h" |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 } | 520 } |
521 for (size_t i = 0; i < autolaunch_tabs.size(); ++i) { | 521 for (size_t i = 0; i < autolaunch_tabs.size(); ++i) { |
522 if (extension_service->IsInstalledApp(autolaunch_tabs.at(i).url)) { | 522 if (extension_service->IsInstalledApp(autolaunch_tabs.at(i).url)) { |
523 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, | 523 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, |
524 extension_misc::APP_LAUNCH_AUTOLAUNCH, | 524 extension_misc::APP_LAUNCH_AUTOLAUNCH, |
525 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); | 525 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); |
526 } | 526 } |
527 } | 527 } |
528 } | 528 } |
529 | 529 |
530 void RegisterComponentsForUpdate() { | 530 void RegisterComponentsForUpdate(const CommandLine& command_line) { |
531 ComponentUpdateService* cus = g_browser_process->component_updater(); | 531 ComponentUpdateService* cus = g_browser_process->component_updater(); |
532 if (!cus) | 532 if (!cus) |
533 return; | 533 return; |
534 // Registration can be before of after cus->Start() so it is ok to post | 534 // Registration can be before of after cus->Start() so it is ok to post |
535 // a task to the UI thread to do registration once you done the necessary | 535 // a task to the UI thread to do registration once you done the necessary |
536 // file IO to know you existing component version. | 536 // file IO to know you existing component version. |
537 RegisterRecoveryComponent(cus, g_browser_process->local_state()); | 537 RegisterRecoveryComponent(cus, g_browser_process->local_state()); |
538 RegisterPepperFlashComponent(cus); | 538 RegisterPepperFlashComponent(cus); |
539 RegisterNPAPIFlashComponent(cus); | 539 RegisterNPAPIFlashComponent(cus); |
540 | 540 |
541 // CRLSetFetcher attempts to load a CRL set from either the local disk | 541 // CRLSetFetcher attempts to load a CRL set from either the local disk or |
542 // or network. | 542 // network. |
543 // TODO(agl): this is disabled for now while it's plumbed in. | 543 if (command_line.HasSwitch(switches::kEnableCRLSets)) |
544 // g_browser_process->crl_set_fetcher()->StartInitialLoad(cus); | 544 g_browser_process->crl_set_fetcher()->StartInitialLoad(cus); |
545 | 545 |
546 cus->Start(); | 546 cus->Start(); |
547 } | 547 } |
548 | 548 |
549 } // namespace | 549 } // namespace |
550 | 550 |
551 | 551 |
552 // BrowserInit ---------------------------------------------------------------- | 552 // BrowserInit ---------------------------------------------------------------- |
553 | 553 |
554 BrowserInit::BrowserInit() {} | 554 BrowserInit::BrowserInit() {} |
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1390 const FilePath& cur_dir, | 1390 const FilePath& cur_dir, |
1391 bool process_startup, | 1391 bool process_startup, |
1392 Profile* profile, | 1392 Profile* profile, |
1393 int* return_code, | 1393 int* return_code, |
1394 BrowserInit* browser_init) { | 1394 BrowserInit* browser_init) { |
1395 DCHECK(profile); | 1395 DCHECK(profile); |
1396 if (process_startup) { | 1396 if (process_startup) { |
1397 if (command_line.HasSwitch(switches::kDisablePromptOnRepost)) | 1397 if (command_line.HasSwitch(switches::kDisablePromptOnRepost)) |
1398 NavigationController::DisablePromptOnRepost(); | 1398 NavigationController::DisablePromptOnRepost(); |
1399 | 1399 |
1400 RegisterComponentsForUpdate(); | 1400 RegisterComponentsForUpdate(command_line); |
1401 | 1401 |
1402 // Look for the testing channel ID ONLY during process startup | 1402 // Look for the testing channel ID ONLY during process startup |
1403 if (command_line.HasSwitch(switches::kTestingChannelID)) { | 1403 if (command_line.HasSwitch(switches::kTestingChannelID)) { |
1404 std::string testing_channel_id = command_line.GetSwitchValueASCII( | 1404 std::string testing_channel_id = command_line.GetSwitchValueASCII( |
1405 switches::kTestingChannelID); | 1405 switches::kTestingChannelID); |
1406 // TODO(sanjeevr) Check if we need to make this a singleton for | 1406 // TODO(sanjeevr) Check if we need to make this a singleton for |
1407 // compatibility with the old testing code | 1407 // compatibility with the old testing code |
1408 // If there are any extra parameters, we expect each one to generate a | 1408 // If there are any extra parameters, we expect each one to generate a |
1409 // new tab; if there are none then we get one homepage tab. | 1409 // new tab; if there are none then we get one homepage tab. |
1410 int expected_tab_count = 1; | 1410 int expected_tab_count = 1; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1536 if (!automation->InitializeChannel(channel_id)) | 1536 if (!automation->InitializeChannel(channel_id)) |
1537 return false; | 1537 return false; |
1538 automation->SetExpectedTabCount(expected_tabs); | 1538 automation->SetExpectedTabCount(expected_tabs); |
1539 | 1539 |
1540 AutomationProviderList* list = g_browser_process->GetAutomationProviderList(); | 1540 AutomationProviderList* list = g_browser_process->GetAutomationProviderList(); |
1541 DCHECK(list); | 1541 DCHECK(list); |
1542 list->AddProvider(automation); | 1542 list->AddProvider(automation); |
1543 | 1543 |
1544 return true; | 1544 return true; |
1545 } | 1545 } |
OLD | NEW |