| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 return true; | 144 return true; |
| 145 } | 145 } |
| 146 | 146 |
| 147 bool ChromeVirtualKeyboardDelegate::SendKeyEvent(const std::string& type, | 147 bool ChromeVirtualKeyboardDelegate::SendKeyEvent(const std::string& type, |
| 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, char_value, key_code, key_name, |
| 155 char_value, | 155 modifiers, window->GetHost()); |
| 156 key_code, | |
| 157 key_name, | |
| 158 modifiers | ui::EF_IS_SYNTHESIZED, | |
| 159 window->GetHost()); | |
| 160 } | 156 } |
| 161 | 157 |
| 162 bool ChromeVirtualKeyboardDelegate::ShowLanguageSettings() { | 158 bool ChromeVirtualKeyboardDelegate::ShowLanguageSettings() { |
| 163 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 159 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 164 content::RecordAction(base::UserMetricsAction("OpenLanguageOptionsDialog")); | 160 content::RecordAction(base::UserMetricsAction("OpenLanguageOptionsDialog")); |
| 165 chrome::ShowSettingsSubPageForProfile(ProfileManager::GetActiveUserProfile(), | 161 chrome::ShowSettingsSubPageForProfile(ProfileManager::GetActiveUserProfile(), |
| 166 chrome::kLanguageOptionsSubPage); | 162 chrome::kLanguageOptionsSubPage); |
| 167 return true; | 163 return true; |
| 168 } | 164 } |
| 169 | 165 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 196 } | 192 } |
| 197 | 193 |
| 198 bool ChromeVirtualKeyboardDelegate::IsLanguageSettingsEnabled() { | 194 bool ChromeVirtualKeyboardDelegate::IsLanguageSettingsEnabled() { |
| 199 return (user_manager::UserManager::Get()->IsUserLoggedIn() && | 195 return (user_manager::UserManager::Get()->IsUserLoggedIn() && |
| 200 !chromeos::UserAddingScreen::Get()->IsRunning() && | 196 !chromeos::UserAddingScreen::Get()->IsRunning() && |
| 201 !(chromeos::ScreenLocker::default_screen_locker() && | 197 !(chromeos::ScreenLocker::default_screen_locker() && |
| 202 chromeos::ScreenLocker::default_screen_locker()->locked())); | 198 chromeos::ScreenLocker::default_screen_locker()->locked())); |
| 203 } | 199 } |
| 204 | 200 |
| 205 } // namespace extensions | 201 } // namespace extensions |
| OLD | NEW |