| 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" |
| 90 #include "chrome/browser/chromeos/low_battery_observer.h" | 91 #include "chrome/browser/chromeos/low_battery_observer.h" |
| 91 #include "chrome/browser/chromeos/network_message_observer.h" | 92 #include "chrome/browser/chromeos/network_message_observer.h" |
| 92 #include "chrome/browser/chromeos/network_state_notifier.h" | 93 #include "chrome/browser/chromeos/network_state_notifier.h" |
| 93 #include "chrome/browser/chromeos/system_key_event_listener.h" | 94 #include "chrome/browser/chromeos/system_key_event_listener.h" |
| 94 #include "chrome/browser/chromeos/update_observer.h" | 95 #include "chrome/browser/chromeos/update_observer.h" |
| 95 #include "chrome/browser/chromeos/usb_mount_observer.h" | 96 #include "chrome/browser/chromeos/usb_mount_observer.h" |
| 96 #include "chrome/browser/chromeos/wm_message_listener.h" | 97 #include "chrome/browser/chromeos/wm_message_listener.h" |
| 97 #include "chrome/browser/chromeos/wm_overview_controller.h" | 98 #include "chrome/browser/chromeos/wm_overview_controller.h" |
| 98 #include "chrome/browser/ui/webui/mediaplayer_ui.h" | 99 #include "chrome/browser/ui/webui/mediaplayer_ui.h" |
| 99 #endif | 100 #endif |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 // Create the WmOverviewController so it can register with the listener. | 575 // Create the WmOverviewController so it can register with the listener. |
| 575 chromeos::WmOverviewController::GetInstance(); | 576 chromeos::WmOverviewController::GetInstance(); |
| 576 | 577 |
| 577 // Install the GView request interceptor that will redirect requests | 578 // Install the GView request interceptor that will redirect requests |
| 578 // of compatible documents (PDF, etc) to the GView document viewer. | 579 // of compatible documents (PDF, etc) to the GView document viewer. |
| 579 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 580 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
| 580 if (parsed_command_line.HasSwitch(switches::kEnableGView)) { | 581 if (parsed_command_line.HasSwitch(switches::kEnableGView)) { |
| 581 chromeos::GViewRequestInterceptor::GetInstance(); | 582 chromeos::GViewRequestInterceptor::GetInstance(); |
| 582 } | 583 } |
| 583 if (process_startup) { | 584 if (process_startup) { |
| 584 // TODO(dhg): Try to make this just USBMountObserver::Get()->set_profile | |
| 585 // and have the constructor take care of everything else. | |
| 586 chromeos::MountLibrary* lib = | |
| 587 chromeos::CrosLibrary::Get()->GetMountLibrary(); | |
| 588 chromeos::USBMountObserver* observe = | |
| 589 chromeos::USBMountObserver::GetInstance(); | |
| 590 lib->AddObserver(observe); | |
| 591 observe->ScanForDevices(lib); | |
| 592 // Connect the chromeos notifications | 585 // Connect the chromeos notifications |
| 593 | 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 |
| 594 // This observer is a singleton. It is never deleted but the pointer is kept | 596 // This observer is a singleton. It is never deleted but the pointer is kept |
| 595 // in a static so that it isn't reported as a leak. | 597 // in a static so that it isn't reported as a leak. |
| 596 static chromeos::LowBatteryObserver* low_battery_observer = | 598 static chromeos::LowBatteryObserver* low_battery_observer = |
| 597 new chromeos::LowBatteryObserver(profile); | 599 new chromeos::LowBatteryObserver(profile); |
| 598 chromeos::CrosLibrary::Get()->GetPowerLibrary()->AddObserver( | 600 chromeos::CrosLibrary::Get()->GetPowerLibrary()->AddObserver( |
| 599 low_battery_observer); | 601 low_battery_observer); |
| 600 | 602 |
| 601 static chromeos::UpdateObserver* update_observer = | 603 static chromeos::UpdateObserver* update_observer = |
| 602 new chromeos::UpdateObserver(profile); | 604 new chromeos::UpdateObserver(profile); |
| 603 chromeos::CrosLibrary::Get()->GetUpdateLibrary()->AddObserver( | 605 chromeos::CrosLibrary::Get()->GetUpdateLibrary()->AddObserver( |
| (...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1379 return false; | 1381 return false; |
| 1380 automation->SetExpectedTabCount(expected_tabs); | 1382 automation->SetExpectedTabCount(expected_tabs); |
| 1381 | 1383 |
| 1382 AutomationProviderList* list = | 1384 AutomationProviderList* list = |
| 1383 g_browser_process->InitAutomationProviderList(); | 1385 g_browser_process->InitAutomationProviderList(); |
| 1384 DCHECK(list); | 1386 DCHECK(list); |
| 1385 list->AddProvider(automation); | 1387 list->AddProvider(automation); |
| 1386 | 1388 |
| 1387 return true; | 1389 return true; |
| 1388 } | 1390 } |
| OLD | NEW |