| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/extensions/api/input/input.h" | 5 #include "chrome/browser/extensions/api/input/input.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 #include "chrome/browser/profiles/profile_manager.h" |
| 12 #include "chrome/browser/ui/chrome_pages.h" |
| 13 #include "chrome/common/url_constants.h" |
| 11 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 12 #include "content/public/browser/user_metrics.h" | 15 #include "content/public/browser/user_metrics.h" |
| 13 #include "extensions/browser/extension_function_registry.h" | 16 #include "extensions/browser/extension_function_registry.h" |
| 14 #include "ui/events/event.h" | 17 #include "ui/events/event.h" |
| 15 #include "ui/keyboard/keyboard_controller.h" | 18 #include "ui/keyboard/keyboard_controller.h" |
| 16 #include "ui/keyboard/keyboard_switches.h" | 19 #include "ui/keyboard/keyboard_switches.h" |
| 17 | 20 |
| 18 #if defined(USE_ASH) | 21 #if defined(USE_ASH) |
| 19 #include "ash/root_window_controller.h" | 22 #include "ash/root_window_controller.h" |
| 20 #include "ash/shell.h" | 23 #include "ash/shell.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 results->SetBoolean("experimental", | 158 results->SetBoolean("experimental", |
| 156 keyboard::IsExperimentalInputViewEnabled()); | 159 keyboard::IsExperimentalInputViewEnabled()); |
| 157 SetResult(results); | 160 SetResult(results); |
| 158 return true; | 161 return true; |
| 159 #else | 162 #else |
| 160 error_ = kNotYetImplementedError; | 163 error_ = kNotYetImplementedError; |
| 161 return false; | 164 return false; |
| 162 #endif | 165 #endif |
| 163 } | 166 } |
| 164 | 167 |
| 168 bool VirtualKeyboardPrivateOpenSettingsFunction::RunSync() { |
| 169 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 170 #if defined(USE_ASH) |
| 171 content::RecordAction(base::UserMetricsAction("OpenLanguageOptionsDialog")); |
| 172 chrome::ShowSettingsSubPageForProfile( |
| 173 ProfileManager::GetActiveUserProfile(), chrome::kLanguageOptionsSubPage); |
| 174 return true; |
| 175 #else |
| 176 error_ = kNotYetImplementedError; |
| 177 return false; |
| 178 #endif |
| 179 } |
| 180 |
| 165 InputAPI::InputAPI(content::BrowserContext* context) {} | 181 InputAPI::InputAPI(content::BrowserContext* context) {} |
| 166 | 182 |
| 167 InputAPI::~InputAPI() { | 183 InputAPI::~InputAPI() { |
| 168 } | 184 } |
| 169 | 185 |
| 170 static base::LazyInstance<BrowserContextKeyedAPIFactory<InputAPI> > g_factory = | 186 static base::LazyInstance<BrowserContextKeyedAPIFactory<InputAPI> > g_factory = |
| 171 LAZY_INSTANCE_INITIALIZER; | 187 LAZY_INSTANCE_INITIALIZER; |
| 172 | 188 |
| 173 // static | 189 // static |
| 174 BrowserContextKeyedAPIFactory<InputAPI>* InputAPI::GetFactoryInstance() { | 190 BrowserContextKeyedAPIFactory<InputAPI>* InputAPI::GetFactoryInstance() { |
| 175 return g_factory.Pointer(); | 191 return g_factory.Pointer(); |
| 176 } | 192 } |
| 177 | 193 |
| 178 } // namespace extensions | 194 } // namespace extensions |
| OLD | NEW |