OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/browser_init.h" | 5 #include "chrome/browser/browser_init.h" |
6 | 6 |
7 #include <shellapi.h> | 7 #include <shellapi.h> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/event_recorder.h" | 11 #include "base/event_recorder.h" |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
13 #include "base/histogram.h" | 13 #include "base/histogram.h" |
14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
15 #include "base/process_util.h" | 15 #include "base/process_util.h" |
16 #include "base/string_util.h" | 16 #include "base/string_util.h" |
17 #include "base/win_util.h" | 17 #include "base/win_util.h" |
18 #include "chrome/app/locales/locale_settings.h" | 18 #include "chrome/app/locales/locale_settings.h" |
19 #include "chrome/app/result_codes.h" | 19 #include "chrome/app/result_codes.h" |
20 #include "chrome/app/theme/theme_resources.h" | 20 #include "chrome/app/theme/theme_resources.h" |
21 #include "chrome/browser/automation/automation_provider.h" | 21 #include "chrome/browser/automation/automation_provider.h" |
22 #include "chrome/browser/browser_list.h" | 22 #include "chrome/browser/browser_list.h" |
23 #include "chrome/browser/browser_process.h" | 23 #include "chrome/browser/browser_process.h" |
24 #include "chrome/browser/dom_ui/new_tab_ui.h" | 24 #include "chrome/browser/dom_ui/new_tab_ui.h" |
| 25 #include "chrome/browser/extensions/extensions_service.h" |
25 #include "chrome/browser/first_run.h" | 26 #include "chrome/browser/first_run.h" |
26 #include "chrome/browser/infobar_delegate.h" | 27 #include "chrome/browser/infobar_delegate.h" |
27 #include "chrome/browser/navigation_controller.h" | 28 #include "chrome/browser/navigation_controller.h" |
28 #include "chrome/browser/net/dns_global.h" | 29 #include "chrome/browser/net/dns_global.h" |
29 #include "chrome/browser/session_restore.h" | 30 #include "chrome/browser/session_restore.h" |
30 #include "chrome/browser/session_startup_pref.h" | 31 #include "chrome/browser/session_startup_pref.h" |
31 #include "chrome/browser/tabs/tab_strip_model.h" | 32 #include "chrome/browser/tabs/tab_strip_model.h" |
32 #include "chrome/browser/url_fixer_upper.h" | 33 #include "chrome/browser/url_fixer_upper.h" |
33 #include "chrome/browser/web_app_launcher.h" | 34 #include "chrome/browser/web_app_launcher.h" |
34 #include "chrome/common/chrome_constants.h" | 35 #include "chrome/common/chrome_constants.h" |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 bool record_mode = parsed_command_line.HasSwitch(switches::kRecordMode); | 474 bool record_mode = parsed_command_line.HasSwitch(switches::kRecordMode); |
474 bool playback_mode = | 475 bool playback_mode = |
475 parsed_command_line.HasSwitch(switches::kPlaybackMode); | 476 parsed_command_line.HasSwitch(switches::kPlaybackMode); |
476 | 477 |
477 if (record_mode && chrome::kRecordModeEnabled) | 478 if (record_mode && chrome::kRecordModeEnabled) |
478 base::EventRecorder::current()->StartRecording(script_path); | 479 base::EventRecorder::current()->StartRecording(script_path); |
479 if (playback_mode) | 480 if (playback_mode) |
480 base::EventRecorder::current()->StartPlayback(script_path); | 481 base::EventRecorder::current()->StartPlayback(script_path); |
481 } | 482 } |
482 } | 483 } |
| 484 |
| 485 // Start up the extensions service |
| 486 if (parsed_command_line.HasSwitch(switches::kEnableExtensions)) |
| 487 profile->GetExtensionsService()->Init(); |
| 488 |
483 return true; | 489 return true; |
484 } | 490 } |
485 | 491 |
486 bool BrowserInit::LaunchWithProfile::OpenStartupURLs( | 492 bool BrowserInit::LaunchWithProfile::OpenStartupURLs( |
487 bool is_process_startup, | 493 bool is_process_startup, |
488 const CommandLine& command_line, | 494 const CommandLine& command_line, |
489 const std::vector<GURL>& urls_to_open) { | 495 const std::vector<GURL>& urls_to_open) { |
490 SessionStartupPref pref = GetSessionStartupPref(profile_, command_line); | 496 SessionStartupPref pref = GetSessionStartupPref(profile_, command_line); |
491 switch (pref.type) { | 497 switch (pref.type) { |
492 case SessionStartupPref::LAST: | 498 case SessionStartupPref::LAST: |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 if (!launched) { | 713 if (!launched) { |
708 LOG(ERROR) << "launch error"; | 714 LOG(ERROR) << "launch error"; |
709 if (return_code != NULL) { | 715 if (return_code != NULL) { |
710 *return_code = ResultCodes::INVALID_CMDLINE_URL; | 716 *return_code = ResultCodes::INVALID_CMDLINE_URL; |
711 } | 717 } |
712 return false; | 718 return false; |
713 } | 719 } |
714 | 720 |
715 return true; | 721 return true; |
716 } | 722 } |
OLD | NEW |