| 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 "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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |