| 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/chromeos/status/caps_lock_menu_button.h" | 5 #include "chrome/browser/chromeos/status/caps_lock_menu_button.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/chromeos/input_method/xkeyboard.h" | 10 #include "chrome/browser/chromeos/input_method/xkeyboard.h" |
| 11 #include "chrome/browser/chromeos/status/status_area_bubble.h" | 11 #include "chrome/browser/chromeos/status/status_area_bubble.h" |
| 12 #include "chrome/browser/chromeos/system/runtime_environment.h" | 12 #include "chrome/browser/chromeos/system/runtime_environment.h" |
| 13 #include "chrome/browser/chromeos/view_ids.h" | 13 #include "chrome/browser/chromeos/view_ids.h" |
| 14 #include "chrome/browser/prefs/pref_service.h" | 14 #include "chrome/browser/prefs/pref_service.h" |
| 15 #include "chrome/browser/profiles/profile_manager.h" | 15 #include "chrome/browser/profiles/profile_manager.h" |
| 16 #include "chrome/common/chrome_notification_types.h" | 16 #include "chrome/common/chrome_notification_types.h" |
| 17 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
| 18 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
| 19 #include "grit/theme_resources.h" | 19 #include "grit/theme_resources.h" |
| 20 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
| 21 #include "ui/base/resource/resource_bundle.h" | 21 #include "ui/base/resource/resource_bundle.h" |
| 22 #include "ui/gfx/image/image.h" | 22 #include "ui/gfx/image/image.h" |
| 23 #include "ui/views/widget/widget.h" |
| 23 #include "views/controls/image_view.h" | 24 #include "views/controls/image_view.h" |
| 24 #include "views/controls/menu/menu_item_view.h" | 25 #include "views/controls/menu/menu_item_view.h" |
| 25 #include "views/controls/menu/menu_runner.h" | 26 #include "views/controls/menu/menu_runner.h" |
| 26 #include "views/controls/menu/submenu_view.h" | 27 #include "views/controls/menu/submenu_view.h" |
| 27 #include "views/widget/widget.h" | |
| 28 | 28 |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| 31 const size_t kMaxBubbleCount = 3; | 31 const size_t kMaxBubbleCount = 3; |
| 32 | 32 |
| 33 PrefService* GetPrefService() { | 33 PrefService* GetPrefService() { |
| 34 Profile* profile = ProfileManager::GetDefaultProfile(); | 34 Profile* profile = ProfileManager::GetDefaultProfile(); |
| 35 if (profile) | 35 if (profile) |
| 36 return profile->GetPrefs(); | 36 return profile->GetPrefs(); |
| 37 return NULL; | 37 return NULL; |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 } | 229 } |
| 230 | 230 |
| 231 bool CapsLockMenuButton::HasCapsLock() const { | 231 bool CapsLockMenuButton::HasCapsLock() const { |
| 232 return (prefs_ && | 232 return (prefs_ && |
| 233 (remap_search_key_to_.GetValue() == input_method::kCapsLockKey)) || | 233 (remap_search_key_to_.GetValue() == input_method::kCapsLockKey)) || |
| 234 // A keyboard for Linux usually has Caps Lock. | 234 // A keyboard for Linux usually has Caps Lock. |
| 235 !system::runtime_environment::IsRunningOnChromeOS(); | 235 !system::runtime_environment::IsRunningOnChromeOS(); |
| 236 } | 236 } |
| 237 | 237 |
| 238 } // namespace chromeos | 238 } // namespace chromeos |
| OLD | NEW |