OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/browser_init.h" | 5 #include "chrome/browser/browser_init.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/event_recorder.h" | 9 #include "base/event_recorder.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 #include "chrome/browser/cocoa/keystone_infobar.h" | 57 #include "chrome/browser/cocoa/keystone_infobar.h" |
58 #endif | 58 #endif |
59 | 59 |
60 #if defined(OS_WIN) | 60 #if defined(OS_WIN) |
61 #include "app/win_util.h" | 61 #include "app/win_util.h" |
62 #endif | 62 #endif |
63 | 63 |
64 #if defined(OS_CHROMEOS) | 64 #if defined(OS_CHROMEOS) |
65 #include "chrome/browser/chromeos/browser_notification_observers.h" | 65 #include "chrome/browser/chromeos/browser_notification_observers.h" |
66 #include "chrome/browser/dom_ui/mediaplayer_ui.h" | 66 #include "chrome/browser/dom_ui/mediaplayer_ui.h" |
| 67 #include "chrome/browser/chromeos/cros/cros_library.h" |
67 #include "chrome/browser/chromeos/cros/mount_library.h" | 68 #include "chrome/browser/chromeos/cros/mount_library.h" |
68 #include "chrome/browser/chromeos/cros/power_library.h" | 69 #include "chrome/browser/chromeos/cros/power_library.h" |
69 #include "chrome/browser/chromeos/gview_request_interceptor.h" | 70 #include "chrome/browser/chromeos/gview_request_interceptor.h" |
70 #include "chrome/browser/chromeos/low_battery_observer.h" | 71 #include "chrome/browser/chromeos/low_battery_observer.h" |
71 #include "chrome/browser/chromeos/usb_mount_observer.h" | 72 #include "chrome/browser/chromeos/usb_mount_observer.h" |
72 #include "chrome/browser/chromeos/wm_message_listener.h" | 73 #include "chrome/browser/chromeos/wm_message_listener.h" |
73 #endif | 74 #endif |
74 | 75 |
75 namespace { | 76 namespace { |
76 | 77 |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 | 397 |
397 // Install the GView request interceptor that will redirect requests | 398 // Install the GView request interceptor that will redirect requests |
398 // of compatible documents (PDF, etc) to the GView document viewer. | 399 // of compatible documents (PDF, etc) to the GView document viewer. |
399 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 400 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
400 if (parsed_command_line.HasSwitch(switches::kEnableGView)) { | 401 if (parsed_command_line.HasSwitch(switches::kEnableGView)) { |
401 chromeos::GViewRequestInterceptor::GetGViewRequestInterceptor(); | 402 chromeos::GViewRequestInterceptor::GetGViewRequestInterceptor(); |
402 } | 403 } |
403 if (process_startup) { | 404 if (process_startup) { |
404 // TODO(dhg): Try to make this just USBMountObserver::Get()->set_profile | 405 // TODO(dhg): Try to make this just USBMountObserver::Get()->set_profile |
405 // and have the constructor take care of everything else. | 406 // and have the constructor take care of everything else. |
406 chromeos::MountLibrary* lib = chromeos::MountLibrary::Get(); | 407 chromeos::MountLibrary* lib = |
| 408 chromeos::CrosLibrary::Get()->GetMountLibrary(); |
407 chromeos::USBMountObserver* observe = chromeos::USBMountObserver::Get(); | 409 chromeos::USBMountObserver* observe = chromeos::USBMountObserver::Get(); |
408 MediaPlayer* player = MediaPlayer::Get(); | 410 MediaPlayer* player = MediaPlayer::Get(); |
409 player->set_profile(profile); | 411 player->set_profile(profile); |
410 observe->set_profile(profile); | 412 observe->set_profile(profile); |
411 lib->AddObserver(observe); | 413 lib->AddObserver(observe); |
412 | 414 |
413 // Connect the chromeos notifications | 415 // Connect the chromeos notifications |
414 | 416 |
415 // This observer is a singleton. It is never deleted but the pointer is kept | 417 // This observer is a singleton. It is never deleted but the pointer is kept |
416 // in a global so that it isn't reported as a leak. | 418 // in a global so that it isn't reported as a leak. |
417 static chromeos::LowBatteryObserver* observer = | 419 static chromeos::LowBatteryObserver* observer = |
418 new chromeos::LowBatteryObserver(profile); | 420 new chromeos::LowBatteryObserver(profile); |
419 chromeos::PowerLibrary::Get()->AddObserver(observer); | 421 chromeos::CrosLibrary::Get()->GetPowerLibrary()->AddObserver(observer); |
420 } | 422 } |
421 #endif | 423 #endif |
422 #if defined(OS_MACOSX) | 424 #if defined(OS_MACOSX) |
423 // TODO(atwilson): Status tray UI is currently only supported on the mac | 425 // TODO(atwilson): Status tray UI is currently only supported on the mac |
424 // (http://crbug.com/37375). | 426 // (http://crbug.com/37375). |
425 if (command_line.HasSwitch(switches::kLongLivedExtensions)) { | 427 if (command_line.HasSwitch(switches::kLongLivedExtensions)) { |
426 // Create status icons | 428 // Create status icons |
427 StatusTrayManager* tray = g_browser_process->status_tray_manager(); | 429 StatusTrayManager* tray = g_browser_process->status_tray_manager(); |
428 if (tray) | 430 if (tray) |
429 tray->Init(profile); | 431 tray->Init(profile); |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 } else { | 926 } else { |
925 ShowPackExtensionMessage(L"Extension Packaging Error", | 927 ShowPackExtensionMessage(L"Extension Packaging Error", |
926 UTF8ToWide(creator->error_message())); | 928 UTF8ToWide(creator->error_message())); |
927 return false; | 929 return false; |
928 } | 930 } |
929 return false; | 931 return false; |
930 } | 932 } |
931 } | 933 } |
932 | 934 |
933 bool silent_launch = false; | 935 bool silent_launch = false; |
| 936 |
934 if (command_line.HasSwitch(switches::kAutomationClientChannelID)) { | 937 if (command_line.HasSwitch(switches::kAutomationClientChannelID)) { |
935 std::string automation_channel_id = command_line.GetSwitchValueASCII( | 938 std::string automation_channel_id = command_line.GetSwitchValueASCII( |
936 switches::kAutomationClientChannelID); | 939 switches::kAutomationClientChannelID); |
937 // If there are any loose parameters, we expect each one to generate a | 940 // If there are any loose parameters, we expect each one to generate a |
938 // new tab; if there are none then we have no tabs | 941 // new tab; if there are none then we have no tabs |
939 size_t expected_tabs = | 942 size_t expected_tabs = |
940 std::max(static_cast<int>(command_line.GetLooseValues().size()), | 943 std::max(static_cast<int>(command_line.GetLooseValues().size()), |
941 0); | 944 0); |
942 if (expected_tabs == 0) | 945 if (expected_tabs == 0) |
943 silent_launch = true; | 946 silent_launch = true; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
993 scoped_refptr<AutomationProviderClass> automation = | 996 scoped_refptr<AutomationProviderClass> automation = |
994 new AutomationProviderClass(profile); | 997 new AutomationProviderClass(profile); |
995 automation->ConnectToChannel(channel_id); | 998 automation->ConnectToChannel(channel_id); |
996 automation->SetExpectedTabCount(expected_tabs); | 999 automation->SetExpectedTabCount(expected_tabs); |
997 | 1000 |
998 AutomationProviderList* list = | 1001 AutomationProviderList* list = |
999 g_browser_process->InitAutomationProviderList(); | 1002 g_browser_process->InitAutomationProviderList(); |
1000 DCHECK(list); | 1003 DCHECK(list); |
1001 list->AddProvider(automation); | 1004 list->AddProvider(automation); |
1002 } | 1005 } |
OLD | NEW |