| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_manager.h" | 10 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
| 11 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 11 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
| 12 #include "chrome/browser/profiles/profile_manager.h" | 12 #include "chrome/browser/profiles/profile_manager.h" |
| 13 #include "chrome/browser/ui/views/handle_web_keyboard_event.h" | |
| 14 #include "chrome/common/url_constants.h" | 13 #include "chrome/common/url_constants.h" |
| 15 #include "content/browser/child_process_security_policy.h" | 14 #include "content/browser/child_process_security_policy.h" |
| 16 #include "content/browser/renderer_host/render_view_host.h" | 15 #include "content/browser/renderer_host/render_view_host.h" |
| 17 #include "content/browser/site_instance.h" | 16 #include "content/browser/site_instance.h" |
| 18 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
| 19 #include "net/url_request/url_request_about_job.h" | 18 #include "net/url_request/url_request_about_job.h" |
| 20 #include "net/url_request/url_request_filter.h" | 19 #include "net/url_request/url_request_filter.h" |
| 21 | 20 |
| 22 using content::OpenURLParams; | 21 using content::OpenURLParams; |
| 23 using content::WebContents; | 22 using content::WebContents; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 source->Stop(); | 123 source->Stop(); |
| 125 // Host registration page and actual registration page hosted by | 124 // Host registration page and actual registration page hosted by |
| 126 // OEM partner doesn't contain links to external URLs. | 125 // OEM partner doesn't contain links to external URLs. |
| 127 LOG(WARNING) << "Navigate to unsupported url: " << params.url.spec(); | 126 LOG(WARNING) << "Navigate to unsupported url: " << params.url.spec(); |
| 128 } | 127 } |
| 129 return NULL; | 128 return NULL; |
| 130 } | 129 } |
| 131 | 130 |
| 132 void RegistrationScreen::HandleKeyboardEvent( | 131 void RegistrationScreen::HandleKeyboardEvent( |
| 133 const NativeWebKeyboardEvent& event) { | 132 const NativeWebKeyboardEvent& event) { |
| 134 HandleWebKeyboardEvent(view()->GetWidget(), event); | 133 unhandled_keyboard_handler_.HandleKeyboardEvent(event, |
| 134 view()->GetFocusManager()); |
| 135 } | 135 } |
| 136 | 136 |
| 137 /////////////////////////////////////////////////////////////////////////////// | 137 /////////////////////////////////////////////////////////////////////////////// |
| 138 // RegistrationScreen, private: | 138 // RegistrationScreen, private: |
| 139 void RegistrationScreen::CloseScreen(ScreenObserver::ExitCodes code) { | 139 void RegistrationScreen::CloseScreen(ScreenObserver::ExitCodes code) { |
| 140 StopTimeoutTimer(); | 140 StopTimeoutTimer(); |
| 141 // Disable input methods since they are not necessary to input username and | 141 // Disable input methods since they are not necessary to input username and |
| 142 // password. | 142 // password. |
| 143 if (g_browser_process) { | 143 if (g_browser_process) { |
| 144 const std::string locale = g_browser_process->GetApplicationLocale(); | 144 const std::string locale = g_browser_process->GetApplicationLocale(); |
| 145 input_method::InputMethodManager* manager = | 145 input_method::InputMethodManager* manager = |
| 146 input_method::InputMethodManager::GetInstance(); | 146 input_method::InputMethodManager::GetInstance(); |
| 147 manager->EnableInputMethods(locale, input_method::kKeyboardLayoutsOnly, ""); | 147 manager->EnableInputMethods(locale, input_method::kKeyboardLayoutsOnly, ""); |
| 148 } | 148 } |
| 149 delegate()->GetObserver()->OnExit(code); | 149 delegate()->GetObserver()->OnExit(code); |
| 150 } | 150 } |
| 151 | 151 |
| 152 // static | 152 // static |
| 153 net::URLRequestJob* RegistrationScreen::Factory(net::URLRequest* request, | 153 net::URLRequestJob* RegistrationScreen::Factory(net::URLRequest* request, |
| 154 const std::string& scheme) { | 154 const std::string& scheme) { |
| 155 VLOG(1) << "Handling url: " << request->url().spec().c_str(); | 155 VLOG(1) << "Handling url: " << request->url().spec().c_str(); |
| 156 return new net::URLRequestAboutJob(request); | 156 return new net::URLRequestAboutJob(request); |
| 157 } | 157 } |
| 158 | 158 |
| 159 } // namespace chromeos | 159 } // namespace chromeos |
| OLD | NEW |