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

Side by Side Diff: chrome/browser/chromeos/login/registration_screen.cc

Issue 6675005: Integrate the new input method API for Views into Chromium. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/chromeos/login/registration_screen.h" 5 #include "chrome/browser/chromeos/login/registration_screen.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/chromeos/input_method/input_method_util.h" 10 #include "chrome/browser/chromeos/input_method/input_method_util.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 source->Stop(); 116 source->Stop();
117 // Host registration page and actual registration page hosted by 117 // Host registration page and actual registration page hosted by
118 // OEM partner doesn't contain links to external URLs. 118 // OEM partner doesn't contain links to external URLs.
119 LOG(WARNING) << "Navigate to unsupported url: " << url.spec(); 119 LOG(WARNING) << "Navigate to unsupported url: " << url.spec();
120 } 120 }
121 } 121 }
122 122
123 void RegistrationScreen::HandleKeyboardEvent( 123 void RegistrationScreen::HandleKeyboardEvent(
124 const NativeWebKeyboardEvent& event) { 124 const NativeWebKeyboardEvent& event) {
125 views::Widget* widget = view()->GetWidget(); 125 views::Widget* widget = view()->GetWidget();
126 if (widget && event.os_event && !event.skip_in_browser) 126 if (widget && event.os_event && !event.skip_in_browser) {
127 static_cast<views::WidgetGtk*>(widget)->HandleKeyboardEvent(event.os_event); 127 views::KeyEvent views_event(reinterpret_cast<GdkEvent*>(event.os_event));
oshima 2011/03/24 22:58:47 does this have to be reinterpret_cast?
James Su 2011/03/25 05:57:21 I think it has to, though I never tried. GdkEvent
oshima 2011/03/25 17:31:25 I see, os_event is key event. It needs to be reint
128 static_cast<views::WidgetGtk*>(widget)->HandleKeyboardEvent(views_event);
129 }
128 } 130 }
129 131
130 /////////////////////////////////////////////////////////////////////////////// 132 ///////////////////////////////////////////////////////////////////////////////
131 // RegistrationScreen, private: 133 // RegistrationScreen, private:
132 void RegistrationScreen::CloseScreen(ScreenObserver::ExitCodes code) { 134 void RegistrationScreen::CloseScreen(ScreenObserver::ExitCodes code) {
133 StopTimeoutTimer(); 135 StopTimeoutTimer();
134 // Disable input methods since they are not necessary to input username and 136 // Disable input methods since they are not necessary to input username and
135 // password. 137 // password.
136 if (g_browser_process) { 138 if (g_browser_process) {
137 const std::string locale = g_browser_process->GetApplicationLocale(); 139 const std::string locale = g_browser_process->GetApplicationLocale();
138 input_method::EnableInputMethods( 140 input_method::EnableInputMethods(
139 locale, input_method::kKeyboardLayoutsOnly, ""); 141 locale, input_method::kKeyboardLayoutsOnly, "");
140 } 142 }
141 delegate()->GetObserver(this)->OnExit(code); 143 delegate()->GetObserver(this)->OnExit(code);
142 } 144 }
143 145
144 // static 146 // static
145 net::URLRequestJob* RegistrationScreen::Factory(net::URLRequest* request, 147 net::URLRequestJob* RegistrationScreen::Factory(net::URLRequest* request,
146 const std::string& scheme) { 148 const std::string& scheme) {
147 VLOG(1) << "Handling url: " << request->url().spec().c_str(); 149 VLOG(1) << "Handling url: " << request->url().spec().c_str();
148 return new net::URLRequestAboutJob(request); 150 return new net::URLRequestAboutJob(request);
149 } 151 }
150 152
151 } // namespace chromeos 153 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698