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

Unified Diff: ui/views/widget/native_widget_win.cc

Issue 10918015: Make HWNDMessageHandler build with use_aura==1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 | « ui/views/widget/native_widget_win.h ('k') | ui/views/win/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/native_widget_win.cc
===================================================================
--- ui/views/widget/native_widget_win.cc (revision 154445)
+++ ui/views/widget/native_widget_win.cc (working copy)
@@ -249,7 +249,12 @@
}
InputMethod* NativeWidgetWin::CreateInputMethod() {
- return message_handler_->CreateInputMethod();
+#if !defined(USE_AURA)
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ if (!command_line->HasSwitch(switches::kEnableViewsTextfield))
+ return NULL;
+#endif
+ return new InputMethodWin(GetMessageHandler());
}
internal::InputMethodDelegate* NativeWidgetWin::GetInputMethodDelegate() {
@@ -470,7 +475,7 @@
}
gfx::Rect NativeWidgetWin::GetWorkAreaBoundsInScreen() const {
- return message_handler_->GetWorkAreaBoundsInScreen();
+ return gfx::Screen::GetDisplayNearestWindow(GetNativeView()).work_area();
}
void NativeWidgetWin::SetInactiveRenderingDisabled(bool value) {
@@ -746,10 +751,16 @@
void NativeWidgetWin::HandleNativeFocus(HWND last_focused_window) {
delegate_->OnNativeFocus(last_focused_window);
+ InputMethod* input_method = GetInputMethod();
+ if (input_method)
+ input_method->OnFocus();
}
void NativeWidgetWin::HandleNativeBlur(HWND focused_window) {
delegate_->OnNativeBlur(focused_window);
+ InputMethod* input_method = GetInputMethod();
+ if (input_method)
+ input_method->OnBlur();
}
bool NativeWidgetWin::HandleMouseEvent(const ui::MouseEvent& event) {
@@ -760,6 +771,38 @@
return delegate_->OnKeyEvent(event);
}
+bool NativeWidgetWin::HandleUntranslatedKeyEvent(const ui::KeyEvent& event) {
+ InputMethod* input_method = GetInputMethod();
+ if (input_method)
+ input_method->DispatchKeyEvent(event);
+ return !!input_method;
+}
+
+bool NativeWidgetWin::HandleIMEMessage(UINT message,
+ WPARAM w_param,
+ LPARAM l_param,
+ LRESULT* result) {
+ InputMethod* input_method = GetInputMethod();
+ if (!input_method || input_method->IsMock()) {
+ *result = 0;
+ return false;
+ }
+
+ InputMethodWin* ime_win = static_cast<InputMethodWin*>(input_method);
+ BOOL handled = FALSE;
+ *result = ime_win->OnImeMessages(message, w_param, l_param, &handled);
+ return !!handled;
+}
+
+void NativeWidgetWin::HandleInputLanguageChange(DWORD character_set,
+ HKL input_language_id) {
+ InputMethod* input_method = GetInputMethod();
+ if (input_method && !input_method->IsMock()) {
+ static_cast<InputMethodWin*>(input_method)->OnInputLangChange(
+ character_set, input_language_id);
+ }
+}
+
bool NativeWidgetWin::HandlePaintAccelerated(const gfx::Rect& invalid_rect) {
return delegate_->OnNativeWidgetPaintAccelerated(gfx::Rect(invalid_rect));
}
« no previous file with comments | « ui/views/widget/native_widget_win.h ('k') | ui/views/win/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698