| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ash/system_tray_delegate_chromeos.h" | 5 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <set> | 11 #include <set> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <utility> | 13 #include <utility> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "ash/common/login_status.h" | 16 #include "ash/common/login_status.h" |
| 17 #include "ash/common/shell_delegate.h" | 17 #include "ash/common/shell_delegate.h" |
| 18 #include "ash/common/system/chromeos/bluetooth/tray_bluetooth_helper.h" | |
| 19 #include "ash/common/system/chromeos/power/power_status.h" | 18 #include "ash/common/system/chromeos/power/power_status.h" |
| 20 #include "ash/common/system/chromeos/session/logout_button_observer.h" | 19 #include "ash/common/system/chromeos/session/logout_button_observer.h" |
| 21 #include "ash/common/system/date/clock_observer.h" | 20 #include "ash/common/system/date/clock_observer.h" |
| 22 #include "ash/common/system/ime/ime_observer.h" | 21 #include "ash/common/system/ime/ime_observer.h" |
| 23 #include "ash/common/system/tray/system_tray_notifier.h" | 22 #include "ash/common/system/tray/system_tray_notifier.h" |
| 24 #include "ash/common/system/tray_accessibility.h" | 23 #include "ash/common/system/tray_accessibility.h" |
| 25 #include "ash/common/system/user/user_observer.h" | 24 #include "ash/common/system/user/user_observer.h" |
| 26 #include "ash/common/wm_shell.h" | 25 #include "ash/common/wm_shell.h" |
| 27 #include "ash/shell.h" | 26 #include "ash/shell.h" |
| 28 #include "ash/system/chromeos/rotation/tray_rotation_lock.h" | 27 #include "ash/system/chromeos/rotation/tray_rotation_lock.h" |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 if (show_intro) { | 333 if (show_intro) { |
| 335 base::Callback<void(bool)> on_accept = | 334 base::Callback<void(bool)> on_accept = |
| 336 base::Bind(&OnAcceptMultiprofilesIntro); | 335 base::Bind(&OnAcceptMultiprofilesIntro); |
| 337 ShowMultiprofilesIntroDialog(on_accept); | 336 ShowMultiprofilesIntroDialog(on_accept); |
| 338 } else { | 337 } else { |
| 339 UserAddingScreen::Get()->Start(); | 338 UserAddingScreen::Get()->Start(); |
| 340 } | 339 } |
| 341 } | 340 } |
| 342 } | 341 } |
| 343 | 342 |
| 344 void SystemTrayDelegateChromeOS::GetAvailableBluetoothDevices( | |
| 345 ash::BluetoothDeviceList* list) { | |
| 346 ash::Shell::Get()->tray_bluetooth_helper()->GetAvailableDevices(list); | |
| 347 } | |
| 348 | |
| 349 void SystemTrayDelegateChromeOS::BluetoothStartDiscovering() { | |
| 350 ash::Shell::Get()->tray_bluetooth_helper()->StartDiscovering(); | |
| 351 } | |
| 352 | |
| 353 void SystemTrayDelegateChromeOS::BluetoothStopDiscovering() { | |
| 354 ash::Shell::Get()->tray_bluetooth_helper()->StopDiscovering(); | |
| 355 } | |
| 356 | |
| 357 void SystemTrayDelegateChromeOS::ConnectToBluetoothDevice( | |
| 358 const std::string& address) { | |
| 359 ash::Shell::Get()->tray_bluetooth_helper()->ConnectToDevice(address); | |
| 360 } | |
| 361 | |
| 362 bool SystemTrayDelegateChromeOS::IsBluetoothDiscovering() const { | |
| 363 return ash::Shell::Get()->tray_bluetooth_helper()->IsDiscovering(); | |
| 364 } | |
| 365 | |
| 366 void SystemTrayDelegateChromeOS::GetCurrentIME(ash::IMEInfo* info) { | 343 void SystemTrayDelegateChromeOS::GetCurrentIME(ash::IMEInfo* info) { |
| 367 input_method::InputMethodManager* manager = | 344 input_method::InputMethodManager* manager = |
| 368 input_method::InputMethodManager::Get(); | 345 input_method::InputMethodManager::Get(); |
| 369 input_method::InputMethodUtil* util = manager->GetInputMethodUtil(); | 346 input_method::InputMethodUtil* util = manager->GetInputMethodUtil(); |
| 370 input_method::InputMethodDescriptor ime = | 347 input_method::InputMethodDescriptor ime = |
| 371 manager->GetActiveIMEState()->GetCurrentInputMethod(); | 348 manager->GetActiveIMEState()->GetCurrentInputMethod(); |
| 372 ExtractIMEInfo(ime, *util, info); | 349 ExtractIMEInfo(ime, *util, info); |
| 373 info->selected = true; | 350 info->selected = true; |
| 374 } | 351 } |
| 375 | 352 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 ->GetActiveIMEState() | 393 ->GetActiveIMEState() |
| 417 ->ChangeInputMethod(ime_id, false /* show_message */); | 394 ->ChangeInputMethod(ime_id, false /* show_message */); |
| 418 input_method::InputMethodSwitchRecorder::Get()->RecordSwitch( | 395 input_method::InputMethodSwitchRecorder::Get()->RecordSwitch( |
| 419 true /* by_tray_menu */); | 396 true /* by_tray_menu */); |
| 420 } | 397 } |
| 421 | 398 |
| 422 void SystemTrayDelegateChromeOS::ActivateIMEProperty(const std::string& key) { | 399 void SystemTrayDelegateChromeOS::ActivateIMEProperty(const std::string& key) { |
| 423 input_method::InputMethodManager::Get()->ActivateInputMethodMenuItem(key); | 400 input_method::InputMethodManager::Get()->ActivateInputMethodMenuItem(key); |
| 424 } | 401 } |
| 425 | 402 |
| 426 void SystemTrayDelegateChromeOS::ToggleBluetooth() { | |
| 427 ash::Shell::Get()->tray_bluetooth_helper()->ToggleEnabled(); | |
| 428 } | |
| 429 | |
| 430 bool SystemTrayDelegateChromeOS::GetBluetoothAvailable() { | |
| 431 return ash::Shell::Get()->tray_bluetooth_helper()->GetAvailable(); | |
| 432 } | |
| 433 | |
| 434 bool SystemTrayDelegateChromeOS::GetBluetoothEnabled() { | |
| 435 return ash::Shell::Get()->tray_bluetooth_helper()->GetEnabled(); | |
| 436 } | |
| 437 | |
| 438 bool SystemTrayDelegateChromeOS::GetBluetoothDiscovering() { | |
| 439 return ash::Shell::Get()->tray_bluetooth_helper()->HasDiscoverySession(); | |
| 440 } | |
| 441 | |
| 442 ash::NetworkingConfigDelegate* | 403 ash::NetworkingConfigDelegate* |
| 443 SystemTrayDelegateChromeOS::GetNetworkingConfigDelegate() const { | 404 SystemTrayDelegateChromeOS::GetNetworkingConfigDelegate() const { |
| 444 return networking_config_delegate_.get(); | 405 return networking_config_delegate_.get(); |
| 445 } | 406 } |
| 446 | 407 |
| 447 bool SystemTrayDelegateChromeOS::GetSessionStartTime( | 408 bool SystemTrayDelegateChromeOS::GetSessionStartTime( |
| 448 base::TimeTicks* session_start_time) { | 409 base::TimeTicks* session_start_time) { |
| 449 *session_start_time = session_start_time_; | 410 *session_start_time = session_start_time_; |
| 450 return have_session_start_time_; | 411 return have_session_start_time_; |
| 451 } | 412 } |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " | 791 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " |
| 831 << "ENABLE_SUPERVISED_USERS undefined."; | 792 << "ENABLE_SUPERVISED_USERS undefined."; |
| 832 return base::string16(); | 793 return base::string16(); |
| 833 } | 794 } |
| 834 | 795 |
| 835 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 796 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
| 836 return new SystemTrayDelegateChromeOS(); | 797 return new SystemTrayDelegateChromeOS(); |
| 837 } | 798 } |
| 838 | 799 |
| 839 } // namespace chromeos | 800 } // namespace chromeos |
| OLD | NEW |