OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromeos/system/ash_system_tray_delegate.h" | 5 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "ash/system/audio/audio_observer.h" | 9 #include "ash/system/audio/audio_observer.h" |
10 #include "ash/system/bluetooth/bluetooth_observer.h" | 10 #include "ash/system/bluetooth/bluetooth_observer.h" |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 content::RecordAction( | 330 content::RecordAction( |
331 content::UserMetricsAction("OpenLanguageOptionsDialog")); | 331 content::UserMetricsAction("OpenLanguageOptionsDialog")); |
332 chrome::ShowSettingsSubPage(GetAppropriateBrowser(), | 332 chrome::ShowSettingsSubPage(GetAppropriateBrowser(), |
333 chrome::kLanguageOptionsSubPage); | 333 chrome::kLanguageOptionsSubPage); |
334 } | 334 } |
335 | 335 |
336 virtual void ShowHelp() OVERRIDE { | 336 virtual void ShowHelp() OVERRIDE { |
337 chrome::ShowHelp(GetAppropriateBrowser(), chrome::HELP_SOURCE_MENU); | 337 chrome::ShowHelp(GetAppropriateBrowser(), chrome::HELP_SOURCE_MENU); |
338 } | 338 } |
339 | 339 |
340 virtual bool IsAudioMuted() const OVERRIDE { | |
341 return AudioHandler::GetInstance()->IsMuted(); | |
342 } | |
343 | |
344 virtual void SetAudioMuted(bool muted) OVERRIDE { | |
345 return AudioHandler::GetInstance()->SetMuted(muted); | |
346 } | |
347 | |
348 virtual float GetVolumeLevel() const OVERRIDE { | |
349 return AudioHandler::GetInstance()->GetVolumePercent() / 100.f; | |
350 } | |
351 | |
352 virtual void SetVolumeLevel(float level) OVERRIDE { | |
353 AudioHandler::GetInstance()->SetVolumePercent(level * 100.f); | |
354 } | |
355 | |
356 virtual bool IsCapsLockOn() const OVERRIDE { | 340 virtual bool IsCapsLockOn() const OVERRIDE { |
357 input_method::InputMethodManager* ime_manager = | 341 input_method::InputMethodManager* ime_manager = |
358 input_method::InputMethodManager::GetInstance(); | 342 input_method::InputMethodManager::GetInstance(); |
359 return ime_manager->GetXKeyboard()->CapsLockIsEnabled(); | 343 return ime_manager->GetXKeyboard()->CapsLockIsEnabled(); |
360 } | 344 } |
361 | 345 |
362 virtual void SetCapsLockEnabled(bool enabled) OVERRIDE { | 346 virtual void SetCapsLockEnabled(bool enabled) OVERRIDE { |
363 input_method::InputMethodManager* ime_manager = | 347 input_method::InputMethodManager* ime_manager = |
364 input_method::InputMethodManager::GetInstance(); | 348 input_method::InputMethodManager::GetInstance(); |
365 return ime_manager->GetXKeyboard()->SetCapsLockEnabled(enabled); | 349 return ime_manager->GetXKeyboard()->SetCapsLockEnabled(enabled); |
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1253 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); | 1237 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); |
1254 }; | 1238 }; |
1255 | 1239 |
1256 } // namespace | 1240 } // namespace |
1257 | 1241 |
1258 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { | 1242 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { |
1259 return new chromeos::SystemTrayDelegate(tray); | 1243 return new chromeos::SystemTrayDelegate(tray); |
1260 } | 1244 } |
1261 | 1245 |
1262 } // namespace chromeos | 1246 } // namespace chromeos |
OLD | NEW |