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

Side by Side Diff: chrome/browser/chromeos/login/html_page_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: Fix Windows build. Created 9 years, 8 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) 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/html_page_screen.h" 5 #include "chrome/browser/chromeos/login/html_page_screen.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.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"
11 #include "chrome/browser/chromeos/login/screen_observer.h" 11 #include "chrome/browser/chromeos/login/screen_observer.h"
12 #include "chrome/browser/profiles/profile_manager.h" 12 #include "chrome/browser/profiles/profile_manager.h"
13 #include "content/browser/renderer_host/render_view_host.h" 13 #include "content/browser/renderer_host/render_view_host.h"
14 #include "content/browser/site_instance.h" 14 #include "content/browser/site_instance.h"
15 #include "content/browser/tab_contents/tab_contents.h" 15 #include "content/browser/tab_contents/tab_contents.h"
16 #include "googleurl/src/gurl.h" 16 #include "googleurl/src/gurl.h"
17 #include "views/events/event.h"
17 #include "views/widget/widget_gtk.h" 18 #include "views/widget/widget_gtk.h"
18 19
19 namespace chromeos { 20 namespace chromeos {
20 21
21 static const char kHTMLPageDoneUrl[] = "about:blank"; 22 static const char kHTMLPageDoneUrl[] = "about:blank";
22 23
23 /////////////////////////////////////////////////////////////////////////////// 24 ///////////////////////////////////////////////////////////////////////////////
24 // HTMLPageDomView 25 // HTMLPageDomView
25 TabContents* HTMLPageDomView::CreateTabContents(Profile* profile, 26 TabContents* HTMLPageDomView::CreateTabContents(Profile* profile,
26 SiteInstance* instance) { 27 SiteInstance* instance) {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 CloseScreen(ScreenObserver::ACCOUNT_CREATE_BACK); 77 CloseScreen(ScreenObserver::ACCOUNT_CREATE_BACK);
77 } 78 }
78 } 79 }
79 80
80 void HTMLPageScreen::NavigationStateChanged(const TabContents* source, 81 void HTMLPageScreen::NavigationStateChanged(const TabContents* source,
81 unsigned changed_flags) { 82 unsigned changed_flags) {
82 } 83 }
83 84
84 void HTMLPageScreen::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { 85 void HTMLPageScreen::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {
85 views::Widget* widget = view()->GetWidget(); 86 views::Widget* widget = view()->GetWidget();
86 if (widget && event.os_event && !event.skip_in_browser) 87 if (widget && event.os_event && !event.skip_in_browser) {
87 static_cast<views::WidgetGtk*>(widget)->HandleKeyboardEvent(event.os_event); 88 views::KeyEvent views_event(reinterpret_cast<GdkEvent*>(event.os_event));
89 static_cast<views::WidgetGtk*>(widget)->HandleKeyboardEvent(views_event);
90 }
88 } 91 }
89 92
90 /////////////////////////////////////////////////////////////////////////////// 93 ///////////////////////////////////////////////////////////////////////////////
91 // HTMLPageScreen, WebPageDelegate implementation: 94 // HTMLPageScreen, WebPageDelegate implementation:
92 void HTMLPageScreen::OnPageLoaded() { 95 void HTMLPageScreen::OnPageLoaded() {
93 StopTimeoutTimer(); 96 StopTimeoutTimer();
94 // Enable input methods (e.g. Chinese, Japanese) so that users could input 97 // Enable input methods (e.g. Chinese, Japanese) so that users could input
95 // their first and last names. 98 // their first and last names.
96 if (g_browser_process) { 99 if (g_browser_process) {
97 const std::string locale = g_browser_process->GetApplicationLocale(); 100 const std::string locale = g_browser_process->GetApplicationLocale();
(...skipping 24 matching lines...) Expand all
122 // password. 125 // password.
123 if (g_browser_process) { 126 if (g_browser_process) {
124 const std::string locale = g_browser_process->GetApplicationLocale(); 127 const std::string locale = g_browser_process->GetApplicationLocale();
125 input_method::EnableInputMethods( 128 input_method::EnableInputMethods(
126 locale, input_method::kKeyboardLayoutsOnly, ""); 129 locale, input_method::kKeyboardLayoutsOnly, "");
127 } 130 }
128 delegate()->GetObserver(this)->OnExit(code); 131 delegate()->GetObserver(this)->OnExit(code);
129 } 132 }
130 133
131 } // namespace chromeos 134 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/eula_view.cc ('k') | chrome/browser/chromeos/login/registration_screen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698