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

Unified Diff: chrome/browser/ui/touch/frame/touch_browser_frame_view.cc

Issue 7074008: initial version of auto VK switching. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: demo update Created 9 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
« no previous file with comments | « chrome/browser/ui/touch/frame/touch_browser_frame_view.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/touch/frame/touch_browser_frame_view.cc
diff --git a/chrome/browser/ui/touch/frame/touch_browser_frame_view.cc b/chrome/browser/ui/touch/frame/touch_browser_frame_view.cc
index d877ce1e7d9caaaddd15e5630fbed90a17e0a955..c2c7e3818be37180c24b68484faba0e0c08f060e 100644
--- a/chrome/browser/ui/touch/frame/touch_browser_frame_view.cc
+++ b/chrome/browser/ui/touch/frame/touch_browser_frame_view.cc
@@ -26,6 +26,11 @@
#include "views/controls/textfield/textfield.h"
#include "views/focus/focus_manager.h"
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/cros/cros_library.h"
+#include "chrome/browser/chromeos/input_method/virtual_keyboard_selector.h"
+#endif
+
namespace {
const int kKeyboardHeight = 360;
@@ -74,6 +79,12 @@ TouchBrowserFrameView::TouchBrowserFrameView(BrowserFrame* frame,
animation_.reset(new ui::SlideAnimation(this));
animation_->SetTweenType(ui::Tween::LINEAR);
animation_->SetSlideDuration(kKeyboardSlideDuration);
+
+#if defined(OS_CHROMEOS)
+ chromeos::InputMethodLibrary* library =
+ chromeos::CrosLibrary::Get()->GetInputMethodLibrary();
+ library->AddVirtualKeyboardObserver(this);
+#endif
}
TouchBrowserFrameView::~TouchBrowserFrameView() {
@@ -325,3 +336,17 @@ void TouchBrowserFrameView::AnimationEnded(const ui::Animation* animation) {
}
SchedulePaint();
}
+
+#if defined(OS_CHROMEOS)
+void TouchBrowserFrameView::VirtualKeyboardChanged(
+ chromeos::InputMethodLibrary* obj,
+ const chromeos::input_method::VirtualKeyboard& virtual_keyboard,
+ const std::string& virtual_keyboard_layout) {
+ if (!keyboard_)
+ return;
+
+ const GURL& url = virtual_keyboard.GetURLForLayout(virtual_keyboard_layout);
+ keyboard_->LoadURL(url);
+ VLOG(1) << "VirtualKeyboardChanged: Switched to " << url.spec();
+}
+#endif
« no previous file with comments | « chrome/browser/ui/touch/frame/touch_browser_frame_view.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698