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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 #endif | 80 #endif |
81 | 81 |
82 #if defined(OS_CHROMEOS) | 82 #if defined(OS_CHROMEOS) |
83 #include "chrome/browser/chromeos/brightness_observer.h" | 83 #include "chrome/browser/chromeos/brightness_observer.h" |
84 #include "chrome/browser/chromeos/cros/cros_library.h" | 84 #include "chrome/browser/chromeos/cros/cros_library.h" |
85 #include "chrome/browser/chromeos/cros/mount_library.h" | 85 #include "chrome/browser/chromeos/cros/mount_library.h" |
86 #include "chrome/browser/chromeos/cros/network_library.h" | 86 #include "chrome/browser/chromeos/cros/network_library.h" |
87 #include "chrome/browser/chromeos/customization_document.h" | 87 #include "chrome/browser/chromeos/customization_document.h" |
88 #include "chrome/browser/chromeos/enterprise_extension_observer.h" | 88 #include "chrome/browser/chromeos/enterprise_extension_observer.h" |
89 #include "chrome/browser/chromeos/gview_request_interceptor.h" | 89 #include "chrome/browser/chromeos/gview_request_interceptor.h" |
90 #include "chrome/browser/chromeos/login/user_manager.h" | |
91 #include "chrome/browser/chromeos/low_battery_observer.h" | 90 #include "chrome/browser/chromeos/low_battery_observer.h" |
92 #include "chrome/browser/chromeos/network_message_observer.h" | 91 #include "chrome/browser/chromeos/network_message_observer.h" |
93 #include "chrome/browser/chromeos/network_state_notifier.h" | 92 #include "chrome/browser/chromeos/network_state_notifier.h" |
94 #include "chrome/browser/chromeos/system_key_event_listener.h" | 93 #include "chrome/browser/chromeos/system_key_event_listener.h" |
95 #include "chrome/browser/chromeos/update_observer.h" | 94 #include "chrome/browser/chromeos/update_observer.h" |
96 #include "chrome/browser/chromeos/usb_mount_observer.h" | 95 #include "chrome/browser/chromeos/usb_mount_observer.h" |
97 #include "chrome/browser/chromeos/wm_message_listener.h" | 96 #include "chrome/browser/chromeos/wm_message_listener.h" |
98 #include "chrome/browser/chromeos/wm_overview_controller.h" | 97 #include "chrome/browser/chromeos/wm_overview_controller.h" |
99 #include "chrome/browser/ui/webui/mediaplayer_ui.h" | 98 #include "chrome/browser/ui/webui/mediaplayer_ui.h" |
100 #endif | 99 #endif |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 // Create the WmOverviewController so it can register with the listener. | 574 // Create the WmOverviewController so it can register with the listener. |
576 chromeos::WmOverviewController::GetInstance(); | 575 chromeos::WmOverviewController::GetInstance(); |
577 | 576 |
578 // Install the GView request interceptor that will redirect requests | 577 // Install the GView request interceptor that will redirect requests |
579 // of compatible documents (PDF, etc) to the GView document viewer. | 578 // of compatible documents (PDF, etc) to the GView document viewer. |
580 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 579 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
581 if (parsed_command_line.HasSwitch(switches::kEnableGView)) { | 580 if (parsed_command_line.HasSwitch(switches::kEnableGView)) { |
582 chromeos::GViewRequestInterceptor::GetInstance(); | 581 chromeos::GViewRequestInterceptor::GetInstance(); |
583 } | 582 } |
584 if (process_startup) { | 583 if (process_startup) { |
585 // Connect the chromeos notifications | |
586 | |
587 if (chromeos::UserManager::Get()->user_is_logged_in()) { | |
588 chromeos::MountLibrary* lib = | |
589 chromeos::CrosLibrary::Get()->GetMountLibrary(); | |
590 chromeos::USBMountObserver* observe = | |
591 chromeos::USBMountObserver::GetInstance(); | |
592 lib->AddObserver(observe); | |
593 lib->RequestMountInfoRefresh(); | |
594 } | |
595 | |
596 // This observer is a singleton. It is never deleted but the pointer is kept | 584 // This observer is a singleton. It is never deleted but the pointer is kept |
597 // in a static so that it isn't reported as a leak. | 585 // in a static so that it isn't reported as a leak. |
598 static chromeos::LowBatteryObserver* low_battery_observer = | 586 static chromeos::LowBatteryObserver* low_battery_observer = |
599 new chromeos::LowBatteryObserver(profile); | 587 new chromeos::LowBatteryObserver(profile); |
600 chromeos::CrosLibrary::Get()->GetPowerLibrary()->AddObserver( | 588 chromeos::CrosLibrary::Get()->GetPowerLibrary()->AddObserver( |
601 low_battery_observer); | 589 low_battery_observer); |
602 | 590 |
603 static chromeos::UpdateObserver* update_observer = | 591 static chromeos::UpdateObserver* update_observer = |
604 new chromeos::UpdateObserver(profile); | 592 new chromeos::UpdateObserver(profile); |
605 chromeos::CrosLibrary::Get()->GetUpdateLibrary()->AddObserver( | 593 chromeos::CrosLibrary::Get()->GetUpdateLibrary()->AddObserver( |
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1403 return false; | 1391 return false; |
1404 automation->SetExpectedTabCount(expected_tabs); | 1392 automation->SetExpectedTabCount(expected_tabs); |
1405 | 1393 |
1406 AutomationProviderList* list = | 1394 AutomationProviderList* list = |
1407 g_browser_process->InitAutomationProviderList(); | 1395 g_browser_process->InitAutomationProviderList(); |
1408 DCHECK(list); | 1396 DCHECK(list); |
1409 list->AddProvider(automation); | 1397 list->AddProvider(automation); |
1410 | 1398 |
1411 return true; | 1399 return true; |
1412 } | 1400 } |
OLD | NEW |