| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 #if defined(OS_WIN) | 75 #if defined(OS_WIN) |
| 76 #include "app/win_util.h" | 76 #include "app/win_util.h" |
| 77 #endif | 77 #endif |
| 78 | 78 |
| 79 #if defined(TOOLKIT_GTK) | 79 #if defined(TOOLKIT_GTK) |
| 80 #include "chrome/browser/gtk/gtk_util.h" | 80 #include "chrome/browser/gtk/gtk_util.h" |
| 81 #endif | 81 #endif |
| 82 | 82 |
| 83 #if defined(OS_CHROMEOS) | 83 #if defined(OS_CHROMEOS) |
| 84 #include "chrome/browser/chromeos/brightness_observer.h" |
| 84 #include "chrome/browser/chromeos/cros/cros_library.h" | 85 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 85 #include "chrome/browser/chromeos/cros/mount_library.h" | 86 #include "chrome/browser/chromeos/cros/mount_library.h" |
| 86 #include "chrome/browser/chromeos/cros/network_library.h" | 87 #include "chrome/browser/chromeos/cros/network_library.h" |
| 87 #include "chrome/browser/chromeos/customization_document.h" | 88 #include "chrome/browser/chromeos/customization_document.h" |
| 88 #include "chrome/browser/chromeos/enterprise_extension_observer.h" | 89 #include "chrome/browser/chromeos/enterprise_extension_observer.h" |
| 89 #include "chrome/browser/chromeos/gview_request_interceptor.h" | 90 #include "chrome/browser/chromeos/gview_request_interceptor.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" |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 // TODO(dhg): Try to make this just USBMountObserver::Get()->set_profile | 438 // TODO(dhg): Try to make this just USBMountObserver::Get()->set_profile |
| 438 // and have the constructor take care of everything else. | 439 // and have the constructor take care of everything else. |
| 439 chromeos::MountLibrary* lib = | 440 chromeos::MountLibrary* lib = |
| 440 chromeos::CrosLibrary::Get()->GetMountLibrary(); | 441 chromeos::CrosLibrary::Get()->GetMountLibrary(); |
| 441 chromeos::USBMountObserver* observe = chromeos::USBMountObserver::Get(); | 442 chromeos::USBMountObserver* observe = chromeos::USBMountObserver::Get(); |
| 442 lib->AddObserver(observe); | 443 lib->AddObserver(observe); |
| 443 observe->ScanForDevices(lib); | 444 observe->ScanForDevices(lib); |
| 444 // Connect the chromeos notifications | 445 // Connect the chromeos notifications |
| 445 | 446 |
| 446 // This observer is a singleton. It is never deleted but the pointer is kept | 447 // This observer is a singleton. It is never deleted but the pointer is kept |
| 447 // in a global so that it isn't reported as a leak. | 448 // in a static so that it isn't reported as a leak. |
| 448 static chromeos::LowBatteryObserver* low_battery_observer = | 449 static chromeos::LowBatteryObserver* low_battery_observer = |
| 449 new chromeos::LowBatteryObserver(profile); | 450 new chromeos::LowBatteryObserver(profile); |
| 450 chromeos::CrosLibrary::Get()->GetPowerLibrary()->AddObserver( | 451 chromeos::CrosLibrary::Get()->GetPowerLibrary()->AddObserver( |
| 451 low_battery_observer); | 452 low_battery_observer); |
| 452 | 453 |
| 453 static chromeos::UpdateObserver* update_observer = | 454 static chromeos::UpdateObserver* update_observer = |
| 454 new chromeos::UpdateObserver(profile); | 455 new chromeos::UpdateObserver(profile); |
| 455 chromeos::CrosLibrary::Get()->GetUpdateLibrary()->AddObserver( | 456 chromeos::CrosLibrary::Get()->GetUpdateLibrary()->AddObserver( |
| 456 update_observer); | 457 update_observer); |
| 457 | 458 |
| 458 static chromeos::NetworkMessageObserver* network_message_observer = | 459 static chromeos::NetworkMessageObserver* network_message_observer = |
| 459 new chromeos::NetworkMessageObserver(profile); | 460 new chromeos::NetworkMessageObserver(profile); |
| 460 chromeos::CrosLibrary::Get()->GetNetworkLibrary() | 461 chromeos::CrosLibrary::Get()->GetNetworkLibrary() |
| 461 ->AddNetworkManagerObserver(network_message_observer); | 462 ->AddNetworkManagerObserver(network_message_observer); |
| 462 chromeos::CrosLibrary::Get()->GetNetworkLibrary() | 463 chromeos::CrosLibrary::Get()->GetNetworkLibrary() |
| 463 ->AddCellularDataPlanObserver(network_message_observer); | 464 ->AddCellularDataPlanObserver(network_message_observer); |
| 464 | 465 |
| 466 static chromeos::BrightnessObserver* brightness_observer = |
| 467 new chromeos::BrightnessObserver(); |
| 468 chromeos::CrosLibrary::Get()->GetBrightnessLibrary() |
| 469 ->AddObserver(brightness_observer); |
| 470 |
| 465 profile->SetupChromeOSEnterpriseExtensionObserver(); | 471 profile->SetupChromeOSEnterpriseExtensionObserver(); |
| 466 } | 472 } |
| 467 #endif | 473 #endif |
| 468 return true; | 474 return true; |
| 469 } | 475 } |
| 470 | 476 |
| 471 // Tab ------------------------------------------------------------------------ | 477 // Tab ------------------------------------------------------------------------ |
| 472 | 478 |
| 473 BrowserInit::LaunchWithProfile::Tab::Tab() : is_app(false), is_pinned(true) {} | 479 BrowserInit::LaunchWithProfile::Tab::Tab() : is_app(false), is_pinned(true) {} |
| 474 | 480 |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1092 return false; | 1098 return false; |
| 1093 automation->SetExpectedTabCount(expected_tabs); | 1099 automation->SetExpectedTabCount(expected_tabs); |
| 1094 | 1100 |
| 1095 AutomationProviderList* list = | 1101 AutomationProviderList* list = |
| 1096 g_browser_process->InitAutomationProviderList(); | 1102 g_browser_process->InitAutomationProviderList(); |
| 1097 DCHECK(list); | 1103 DCHECK(list); |
| 1098 list->AddProvider(automation); | 1104 list->AddProvider(automation); |
| 1099 | 1105 |
| 1100 return true; | 1106 return true; |
| 1101 } | 1107 } |
| OLD | NEW |