diff options
5 files changed, 22 insertions, 9 deletions
diff --git a/chrome/browser/chromeos/login/touch_login_view.cc b/chrome/browser/chromeos/login/touch_login_view.cc index 85e80579..e8572de 100644 --- a/chrome/browser/chromeos/login/touch_login_view.cc +++ b/chrome/browser/chromeos/login/touch_login_view.cc @@ -13,6 +13,7 @@ #include "chrome/common/chrome_notification_types.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/common/notification_service.h" +#include "googleurl/src/gurl.h" #include "ui/base/animation/slide_animation.h" #include "ui/gfx/transform.h" #include "views/controls/textfield/textfield.h" @@ -132,7 +133,9 @@ void TouchLoginView::InitStatusArea() { // TouchLoginView private: ----------------------------------------------------- void TouchLoginView::InitVirtualKeyboard() { - keyboard_ = new KeyboardContainerView(profile_, NULL); + // TODO(yusukes): Support non-US virtual keyboard on the login screen. + keyboard_ = new KeyboardContainerView(profile_, NULL, GURL()); + keyboard_->SetVisible(false); AddChildView(keyboard_); diff --git a/chrome/browser/ui/touch/frame/keyboard_container_view.cc b/chrome/browser/ui/touch/frame/keyboard_container_view.cc index b8c0b80..5af9ed2 100644 --- a/chrome/browser/ui/touch/frame/keyboard_container_view.cc +++ b/chrome/browser/ui/touch/frame/keyboard_container_view.cc @@ -30,12 +30,14 @@ const char KeyboardContainerView::kViewClassName[] = /////////////////////////////////////////////////////////////////////////////// // KeyboardContainerView, public: -KeyboardContainerView::KeyboardContainerView(Profile* profile, Browser* browser) +KeyboardContainerView::KeyboardContainerView( + Profile* profile, Browser* browser, const GURL& url) : dom_view_(new DOMView), ALLOW_THIS_IN_INITIALIZER_LIST( extension_function_dispatcher_(profile, this)), browser_(browser) { - GURL keyboard_url(chrome::kChromeUIKeyboardURL); + const GURL keyboard_url( + url.is_valid() ? url : GURL(chrome::kChromeUIKeyboardURL)); dom_view_->Init(profile, SiteInstance::CreateSiteInstanceForURL(profile, keyboard_url)); dom_view_->LoadURL(keyboard_url); diff --git a/chrome/browser/ui/touch/frame/keyboard_container_view.h b/chrome/browser/ui/touch/frame/keyboard_container_view.h index 90a805c..d3d0735 100644 --- a/chrome/browser/ui/touch/frame/keyboard_container_view.h +++ b/chrome/browser/ui/touch/frame/keyboard_container_view.h @@ -17,6 +17,7 @@ class Message; class Browser; class DOMView; +class GURL; class Profile; // A class that contains and decorates the virtual keyboard. @@ -30,7 +31,7 @@ class KeyboardContainerView : public views::View, // Internal class name. static const char kViewClassName[]; - KeyboardContainerView(Profile* profile, Browser* browser); + KeyboardContainerView(Profile* profile, Browser* browser, const GURL& url); virtual ~KeyboardContainerView(); // Overridden from views::View 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 b1ae5b4..6223832f 100644 --- a/chrome/browser/ui/touch/frame/touch_browser_frame_view.cc +++ b/chrome/browser/ui/touch/frame/touch_browser_frame_view.cc @@ -167,7 +167,8 @@ void TouchBrowserFrameView::InitVirtualKeyboard() { DCHECK(keyboard_profile) << "Profile required for virtual keyboard."; keyboard_ = new KeyboardContainerView(keyboard_profile, - browser_view()->browser()); + browser_view()->browser(), + url_); keyboard_->SetVisible(false); AddChildView(keyboard_); } @@ -366,11 +367,15 @@ void TouchBrowserFrameView::VirtualKeyboardChanged( chromeos::input_method::InputMethodManager* manager, const chromeos::input_method::VirtualKeyboard& virtual_keyboard, const std::string& virtual_keyboard_layout) { - if (!keyboard_) + const GURL& new_url = + virtual_keyboard.GetURLForLayout(virtual_keyboard_layout); + if (new_url == url_) return; - const GURL& url = virtual_keyboard.GetURLForLayout(virtual_keyboard_layout); - keyboard_->LoadURL(url); - VLOG(1) << "VirtualKeyboardChanged: Switched to " << url.spec(); + url_ = new_url; + if (keyboard_) + keyboard_->LoadURL(url_); + // |keyboard_| can be NULL here. In that case, the |url_| will be used in + // InitVirtualKeyboard() later. } #endif diff --git a/chrome/browser/ui/touch/frame/touch_browser_frame_view.h b/chrome/browser/ui/touch/frame/touch_browser_frame_view.h index 6f02128..370279d 100644 --- a/chrome/browser/ui/touch/frame/touch_browser_frame_view.h +++ b/chrome/browser/ui/touch/frame/touch_browser_frame_view.h @@ -10,6 +10,7 @@ #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" #include "content/common/notification_observer.h" #include "content/common/notification_registrar.h" +#include "googleurl/src/gurl.h" #include "ui/base/animation/animation_delegate.h" #include "views/focus/focus_manager.h" @@ -102,6 +103,7 @@ class TouchBrowserFrameView bool focus_listener_added_; KeyboardContainerView* keyboard_; NotificationRegistrar registrar_; + GURL url_; scoped_ptr<ui::SlideAnimation> animation_; |