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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 return input_method; | 244 return input_method; |
245 } | 245 } |
246 | 246 |
247 void NativeWidgetViews::CenterWindow(const gfx::Size& size) { | 247 void NativeWidgetViews::CenterWindow(const gfx::Size& size) { |
248 const gfx::Size parent_size = GetView()->parent()->size(); | 248 const gfx::Size parent_size = GetView()->parent()->size(); |
249 GetView()->SetBounds((parent_size.width() - size.width())/2, | 249 GetView()->SetBounds((parent_size.width() - size.width())/2, |
250 (parent_size.height() - size.height())/2, | 250 (parent_size.height() - size.height())/2, |
251 size.width(), size.height()); | 251 size.width(), size.height()); |
252 } | 252 } |
253 | 253 |
254 void NativeWidgetViews::GetWindowBoundsAndMaximizedState( | 254 void NativeWidgetViews::GetWindowPlacement( |
255 gfx::Rect* bounds, | 255 gfx::Rect* bounds, |
256 bool* maximized) const { | 256 ui::WindowShowState* show_state) const { |
257 *bounds = GetView()->bounds(); | 257 *bounds = GetView()->bounds(); |
258 *maximized = false; | 258 *show_state = ui::SHOW_STATE_NORMAL; |
259 } | 259 } |
260 | 260 |
261 void NativeWidgetViews::SetWindowTitle(const std::wstring& title) { | 261 void NativeWidgetViews::SetWindowTitle(const std::wstring& title) { |
262 } | 262 } |
263 | 263 |
264 void NativeWidgetViews::SetWindowIcons(const SkBitmap& window_icon, | 264 void NativeWidgetViews::SetWindowIcons(const SkBitmap& window_icon, |
265 const SkBitmap& app_icon) { | 265 const SkBitmap& app_icon) { |
266 } | 266 } |
267 | 267 |
268 void NativeWidgetViews::SetAccessibleName(const std::wstring& name) { | 268 void NativeWidgetViews::SetAccessibleName(const std::wstring& name) { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 view_->SetVisible(true); | 342 view_->SetVisible(true); |
343 GetWidget()->SetInitialFocus(); | 343 GetWidget()->SetInitialFocus(); |
344 } | 344 } |
345 | 345 |
346 void NativeWidgetViews::Hide() { | 346 void NativeWidgetViews::Hide() { |
347 view_->SetVisible(false); | 347 view_->SetVisible(false); |
348 if (HasMouseCapture()) | 348 if (HasMouseCapture()) |
349 ReleaseMouseCapture(); | 349 ReleaseMouseCapture(); |
350 } | 350 } |
351 | 351 |
352 void NativeWidgetViews::ShowWithState(ShowState state) { | 352 void NativeWidgetViews::ShowWithWindowState(ui::WindowShowState show_state) { |
353 Show(); | 353 Show(); |
354 } | 354 } |
355 | 355 |
356 void NativeWidgetViews::ShowMaximizedWithBounds( | 356 void NativeWidgetViews::ShowMaximizedWithBounds( |
357 const gfx::Rect& restored_bounds) { | 357 const gfx::Rect& restored_bounds) { |
358 Show(); | 358 Show(); |
359 } | 359 } |
360 | 360 |
361 bool NativeWidgetViews::IsVisible() const { | 361 bool NativeWidgetViews::IsVisible() const { |
362 return view_->IsVisible(); | 362 return view_->IsVisible(); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 | 508 |
509 const internal::NativeWidgetPrivate* | 509 const internal::NativeWidgetPrivate* |
510 NativeWidgetViews::GetParentNativeWidget() const { | 510 NativeWidgetViews::GetParentNativeWidget() const { |
511 const Widget* containing_widget = view_ ? view_->GetWidget() : NULL; | 511 const Widget* containing_widget = view_ ? view_->GetWidget() : NULL; |
512 return containing_widget ? static_cast<const internal::NativeWidgetPrivate*>( | 512 return containing_widget ? static_cast<const internal::NativeWidgetPrivate*>( |
513 containing_widget->native_widget()) : | 513 containing_widget->native_widget()) : |
514 NULL; | 514 NULL; |
515 } | 515 } |
516 | 516 |
517 } // namespace views | 517 } // namespace views |
OLD | NEW |