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

Side by Side Diff: views/widget/native_widget_views.cc

Issue 7746005: Focus fix. InputMethod needs to be initialized before calling OnFocus (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/widget/native_widget_gtk.cc ('k') | views/widget/native_widget_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "views/widget/native_widget_views.h" 5 #include "views/widget/native_widget_views.h"
6 6
7 #include "ui/gfx/compositor/compositor.h" 7 #include "ui/gfx/compositor/compositor.h"
8 #include "views/desktop/desktop_window_view.h" 8 #include "views/desktop/desktop_window_view.h"
9 #include "views/view.h" 9 #include "views/view.h"
10 #include "views/views_delegate.h" 10 #include "views/views_delegate.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 void NativeWidgetViews::ReleaseMouseCapture() { 229 void NativeWidgetViews::ReleaseMouseCapture() {
230 WindowManager::Get()->ReleaseMouseCapture(GetWidget()); 230 WindowManager::Get()->ReleaseMouseCapture(GetWidget());
231 } 231 }
232 232
233 bool NativeWidgetViews::HasMouseCapture() const { 233 bool NativeWidgetViews::HasMouseCapture() const {
234 return WindowManager::Get()->HasMouseCapture(GetWidget()); 234 return WindowManager::Get()->HasMouseCapture(GetWidget());
235 } 235 }
236 236
237 InputMethod* NativeWidgetViews::CreateInputMethod() { 237 InputMethod* NativeWidgetViews::CreateInputMethod() {
238 #if defined(HAVE_IBUS) 238 #if defined(HAVE_IBUS)
239 return new InputMethodIBus(this); 239 InputMethod* input_method = new InputMethodIBus(this);
240 #else 240 #else
241 return new MockInputMethod(this); 241 InputMethod* input_method = new MockInputMethod(this);
242 #endif 242 #endif
243 input_method->Init(GetWidget());
244 return input_method;
243 } 245 }
244 246
245 void NativeWidgetViews::CenterWindow(const gfx::Size& size) { 247 void NativeWidgetViews::CenterWindow(const gfx::Size& size) {
246 const gfx::Size parent_size = GetView()->parent()->size(); 248 const gfx::Size parent_size = GetView()->parent()->size();
247 GetView()->SetBounds((parent_size.width() - size.width())/2, 249 GetView()->SetBounds((parent_size.width() - size.width())/2,
248 (parent_size.height() - size.height())/2, 250 (parent_size.height() - size.height())/2,
249 size.width(), size.height()); 251 size.width(), size.height());
250 } 252 }
251 253
252 void NativeWidgetViews::GetWindowBoundsAndMaximizedState( 254 void NativeWidgetViews::GetWindowBoundsAndMaximizedState(
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 508
507 const internal::NativeWidgetPrivate* 509 const internal::NativeWidgetPrivate*
508 NativeWidgetViews::GetParentNativeWidget() const { 510 NativeWidgetViews::GetParentNativeWidget() const {
509 const Widget* containing_widget = view_ ? view_->GetWidget() : NULL; 511 const Widget* containing_widget = view_ ? view_->GetWidget() : NULL;
510 return containing_widget ? static_cast<const internal::NativeWidgetPrivate*>( 512 return containing_widget ? static_cast<const internal::NativeWidgetPrivate*>(
511 containing_widget->native_widget()) : 513 containing_widget->native_widget()) :
512 NULL; 514 NULL;
513 } 515 }
514 516
515 } // namespace views 517 } // namespace views
OLDNEW
« no previous file with comments | « views/widget/native_widget_gtk.cc ('k') | views/widget/native_widget_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698