Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5870)

Unified Diff: chrome/browser/extensions/api/input/input.cc

Issue 342573002: Add chrome.virtualKeyboardPrivate.openSettings api to open settings page (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/input/input.cc
diff --git a/chrome/browser/extensions/api/input/input.cc b/chrome/browser/extensions/api/input/input.cc
index 847072a877dcb433c058daa86821e4dd00217ab8..2e2772b08f5308aa932953d2cf6c091efa5c498e 100644
--- a/chrome/browser/extensions/api/input/input.cc
+++ b/chrome/browser/extensions/api/input/input.cc
@@ -8,6 +8,9 @@
#include "base/lazy_instance.h"
#include "base/metrics/histogram.h"
#include "base/strings/string16.h"
+#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/ui/chrome_pages.h"
+#include "chrome/common/url_constants.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/user_metrics.h"
#include "extensions/browser/extension_function_registry.h"
@@ -162,6 +165,19 @@ bool VirtualKeyboardPrivateGetKeyboardConfigFunction::RunSync() {
#endif
}
+bool VirtualKeyboardPrivateOpenSettingsFunction::RunSync() {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+#if defined(USE_ASH)
+ content::RecordAction(base::UserMetricsAction("OpenLanguageOptionsDialog"));
+ chrome::ShowSettingsSubPageForProfile(
+ ProfileManager::GetActiveUserProfile(), chrome::kLanguageOptionsSubPage);
+ return true;
+#else
+ error_ = kNotYetImplementedError;
+ return false;
+#endif
+}
+
InputAPI::InputAPI(content::BrowserContext* context) {}
InputAPI::~InputAPI() {
« no previous file with comments | « chrome/browser/extensions/api/input/input.h ('k') | chrome/common/extensions/api/virtual_keyboard_private.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698