| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extensions/api/virtual_keyboard_private/chrome_virtual_
keyboard_delegate.h" | 5 #include "chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_
keyboard_delegate.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 int char_value, | 148 int char_value, |
| 149 int key_code, | 149 int key_code, |
| 150 const std::string& key_name, | 150 const std::string& key_name, |
| 151 int modifiers) { | 151 int modifiers) { |
| 152 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 152 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 153 aura::Window* window = GetKeyboardContainer(); | 153 aura::Window* window = GetKeyboardContainer(); |
| 154 return window && keyboard::SendKeyEvent(type, | 154 return window && keyboard::SendKeyEvent(type, |
| 155 char_value, | 155 char_value, |
| 156 key_code, | 156 key_code, |
| 157 key_name, | 157 key_name, |
| 158 modifiers, | 158 modifiers | ui::EF_IS_SYNTHESIZED, |
| 159 window->GetHost()); | 159 window->GetHost()); |
| 160 } | 160 } |
| 161 | 161 |
| 162 bool ChromeVirtualKeyboardDelegate::ShowLanguageSettings() { | 162 bool ChromeVirtualKeyboardDelegate::ShowLanguageSettings() { |
| 163 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 163 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 164 content::RecordAction(base::UserMetricsAction("OpenLanguageOptionsDialog")); | 164 content::RecordAction(base::UserMetricsAction("OpenLanguageOptionsDialog")); |
| 165 chrome::ShowSettingsSubPageForProfile(ProfileManager::GetActiveUserProfile(), | 165 chrome::ShowSettingsSubPageForProfile(ProfileManager::GetActiveUserProfile(), |
| 166 chrome::kLanguageOptionsSubPage); | 166 chrome::kLanguageOptionsSubPage); |
| 167 return true; | 167 return true; |
| 168 } | 168 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 196 } | 196 } |
| 197 | 197 |
| 198 bool ChromeVirtualKeyboardDelegate::IsLanguageSettingsEnabled() { | 198 bool ChromeVirtualKeyboardDelegate::IsLanguageSettingsEnabled() { |
| 199 return (user_manager::UserManager::Get()->IsUserLoggedIn() && | 199 return (user_manager::UserManager::Get()->IsUserLoggedIn() && |
| 200 !chromeos::UserAddingScreen::Get()->IsRunning() && | 200 !chromeos::UserAddingScreen::Get()->IsRunning() && |
| 201 !(chromeos::ScreenLocker::default_screen_locker() && | 201 !(chromeos::ScreenLocker::default_screen_locker() && |
| 202 chromeos::ScreenLocker::default_screen_locker()->locked())); | 202 chromeos::ScreenLocker::default_screen_locker()->locked())); |
| 203 } | 203 } |
| 204 | 204 |
| 205 } // namespace extensions | 205 } // namespace extensions |
| OLD | NEW |