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

Side by Side Diff: chrome/browser/ui/browser_init.cc

Issue 8348026: Add a component installer for Portable NaCl. Registration of installer is (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years, 2 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
OLDNEW
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 #include "chrome/browser/ui/webui/sync_promo_ui.h" 62 #include "chrome/browser/ui/webui/sync_promo_ui.h"
63 #include "chrome/common/chrome_constants.h" 63 #include "chrome/common/chrome_constants.h"
64 #include "chrome/common/chrome_paths.h" 64 #include "chrome/common/chrome_paths.h"
65 #include "chrome/common/chrome_result_codes.h" 65 #include "chrome/common/chrome_result_codes.h"
66 #include "chrome/common/chrome_switches.h" 66 #include "chrome/common/chrome_switches.h"
67 #include "chrome/common/chrome_version_info.h" 67 #include "chrome/common/chrome_version_info.h"
68 #include "chrome/common/extensions/extension_constants.h" 68 #include "chrome/common/extensions/extension_constants.h"
69 #include "chrome/common/pref_names.h" 69 #include "chrome/common/pref_names.h"
70 #include "chrome/common/url_constants.h" 70 #include "chrome/common/url_constants.h"
71 #include "chrome/installer/util/browser_distribution.h" 71 #include "chrome/installer/util/browser_distribution.h"
72 #include "chrome/nacl/pnacl_component_installer.h"
72 #include "content/browser/browser_thread.h" 73 #include "content/browser/browser_thread.h"
73 #include "content/browser/child_process_security_policy.h" 74 #include "content/browser/child_process_security_policy.h"
74 #include "content/browser/renderer_host/render_process_host.h" 75 #include "content/browser/renderer_host/render_process_host.h"
75 #include "content/browser/tab_contents/navigation_details.h" 76 #include "content/browser/tab_contents/navigation_details.h"
76 #include "content/browser/tab_contents/tab_contents_view.h" 77 #include "content/browser/tab_contents/tab_contents_view.h"
77 #include "grit/chromium_strings.h" 78 #include "grit/chromium_strings.h"
78 #include "grit/generated_resources.h" 79 #include "grit/generated_resources.h"
79 #include "grit/locale_settings.h" 80 #include "grit/locale_settings.h"
80 #include "grit/theme_resources.h" 81 #include "grit/theme_resources.h"
81 #include "grit/theme_resources_standard.h" 82 #include "grit/theme_resources_standard.h"
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 } 521 }
521 for (size_t i = 0; i < autolaunch_tabs.size(); ++i) { 522 for (size_t i = 0; i < autolaunch_tabs.size(); ++i) {
522 if (extension_service->IsInstalledApp(autolaunch_tabs.at(i).url)) { 523 if (extension_service->IsInstalledApp(autolaunch_tabs.at(i).url)) {
523 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, 524 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram,
524 extension_misc::APP_LAUNCH_AUTOLAUNCH, 525 extension_misc::APP_LAUNCH_AUTOLAUNCH,
525 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); 526 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY);
526 } 527 }
527 } 528 }
528 } 529 }
529 530
530 void RegisterComponentsForUpdate() { 531 void RegisterComponentsForUpdate(const CommandLine& command_line) {
531 ComponentUpdateService* cus = g_browser_process->component_updater(); 532 ComponentUpdateService* cus = g_browser_process->component_updater();
532 if (!cus) 533 if (!cus)
533 return; 534 return;
534 // Registration can be before of after cus->Start() so it is ok to post 535 // 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 536 // a task to the UI thread to do registration once you done the necessary
536 // file IO to know you existing component version. 537 // file IO to know you existing component version.
537 RegisterRecoveryComponent(cus, g_browser_process->local_state()); 538 RegisterRecoveryComponent(cus, g_browser_process->local_state());
538 RegisterPepperFlashComponent(cus); 539 RegisterPepperFlashComponent(cus);
539 RegisterNPAPIFlashComponent(cus); 540 RegisterNPAPIFlashComponent(cus);
540 541
542 // This developer version of PNaCl should only be installed for developers.
543 if (command_line.HasSwitch(switches::kEnablePNaCl)) {
544 RegisterPNaClComponent(cus);
545 }
546
541 // CRLSetFetcher attempts to load a CRL set from either the local disk 547 // CRLSetFetcher attempts to load a CRL set from either the local disk
542 // or network. 548 // or network.
543 // TODO(agl): this is disabled for now while it's plumbed in. 549 // TODO(agl): this is disabled for now while it's plumbed in.
544 // g_browser_process->crl_set_fetcher()->StartInitialLoad(cus); 550 // g_browser_process->crl_set_fetcher()->StartInitialLoad(cus);
545 551
546 cus->Start(); 552 cus->Start();
547 } 553 }
548 554
549 } // namespace 555 } // namespace
550 556
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
1388 const FilePath& cur_dir, 1394 const FilePath& cur_dir,
1389 bool process_startup, 1395 bool process_startup,
1390 Profile* profile, 1396 Profile* profile,
1391 int* return_code, 1397 int* return_code,
1392 BrowserInit* browser_init) { 1398 BrowserInit* browser_init) {
1393 DCHECK(profile); 1399 DCHECK(profile);
1394 if (process_startup) { 1400 if (process_startup) {
1395 if (command_line.HasSwitch(switches::kDisablePromptOnRepost)) 1401 if (command_line.HasSwitch(switches::kDisablePromptOnRepost))
1396 NavigationController::DisablePromptOnRepost(); 1402 NavigationController::DisablePromptOnRepost();
1397 1403
1398 RegisterComponentsForUpdate(); 1404 RegisterComponentsForUpdate(command_line);
1399 1405
1400 // Look for the testing channel ID ONLY during process startup 1406 // Look for the testing channel ID ONLY during process startup
1401 if (command_line.HasSwitch(switches::kTestingChannelID)) { 1407 if (command_line.HasSwitch(switches::kTestingChannelID)) {
1402 std::string testing_channel_id = command_line.GetSwitchValueASCII( 1408 std::string testing_channel_id = command_line.GetSwitchValueASCII(
1403 switches::kTestingChannelID); 1409 switches::kTestingChannelID);
1404 // TODO(sanjeevr) Check if we need to make this a singleton for 1410 // TODO(sanjeevr) Check if we need to make this a singleton for
1405 // compatibility with the old testing code 1411 // compatibility with the old testing code
1406 // If there are any extra parameters, we expect each one to generate a 1412 // If there are any extra parameters, we expect each one to generate a
1407 // new tab; if there are none then we get one homepage tab. 1413 // new tab; if there are none then we get one homepage tab.
1408 int expected_tab_count = 1; 1414 int expected_tab_count = 1;
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
1534 if (!automation->InitializeChannel(channel_id)) 1540 if (!automation->InitializeChannel(channel_id))
1535 return false; 1541 return false;
1536 automation->SetExpectedTabCount(expected_tabs); 1542 automation->SetExpectedTabCount(expected_tabs);
1537 1543
1538 AutomationProviderList* list = g_browser_process->GetAutomationProviderList(); 1544 AutomationProviderList* list = g_browser_process->GetAutomationProviderList();
1539 DCHECK(list); 1545 DCHECK(list);
1540 list->AddProvider(automation); 1546 list->AddProvider(automation);
1541 1547
1542 return true; 1548 return true;
1543 } 1549 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698