| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/widget/widget.h" | 5 #include "ui/views/widget/widget.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 activatable(ACTIVATABLE_DEFAULT), | 122 activatable(ACTIVATABLE_DEFAULT), |
| 123 keep_on_top(type == TYPE_MENU || type == TYPE_DRAG), | 123 keep_on_top(type == TYPE_MENU || type == TYPE_DRAG), |
| 124 visible_on_all_workspaces(false), | 124 visible_on_all_workspaces(false), |
| 125 ownership(NATIVE_WIDGET_OWNS_WIDGET), | 125 ownership(NATIVE_WIDGET_OWNS_WIDGET), |
| 126 mirror_origin_in_rtl(false), | 126 mirror_origin_in_rtl(false), |
| 127 shadow_type(SHADOW_TYPE_DEFAULT), | 127 shadow_type(SHADOW_TYPE_DEFAULT), |
| 128 remove_standard_frame(false), | 128 remove_standard_frame(false), |
| 129 use_system_default_icon(false), | 129 use_system_default_icon(false), |
| 130 show_state(ui::SHOW_STATE_DEFAULT), | 130 show_state(ui::SHOW_STATE_DEFAULT), |
| 131 parent(nullptr), | 131 parent(nullptr), |
| 132 workspace(-1), |
| 132 native_widget(nullptr), | 133 native_widget(nullptr), |
| 133 desktop_window_tree_host(nullptr), | 134 desktop_window_tree_host(nullptr), |
| 134 layer_type(ui::LAYER_TEXTURED), | 135 layer_type(ui::LAYER_TEXTURED), |
| 135 context(nullptr), | 136 context(nullptr), |
| 136 force_show_in_taskbar(false), | 137 force_show_in_taskbar(false), |
| 137 force_software_compositing(false) { | 138 force_software_compositing(false) {} |
| 138 } | |
| 139 | 139 |
| 140 Widget::InitParams::InitParams(const InitParams& other) = default; | 140 Widget::InitParams::InitParams(const InitParams& other) = default; |
| 141 | 141 |
| 142 Widget::InitParams::~InitParams() { | 142 Widget::InitParams::~InitParams() { |
| 143 } | 143 } |
| 144 | 144 |
| 145 //////////////////////////////////////////////////////////////////////////////// | 145 //////////////////////////////////////////////////////////////////////////////// |
| 146 // Widget, public: | 146 // Widget, public: |
| 147 | 147 |
| 148 Widget::Widget() | 148 Widget::Widget() |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 } | 482 } |
| 483 | 483 |
| 484 gfx::Rect Widget::GetClientAreaBoundsInScreen() const { | 484 gfx::Rect Widget::GetClientAreaBoundsInScreen() const { |
| 485 return native_widget_->GetClientAreaBoundsInScreen(); | 485 return native_widget_->GetClientAreaBoundsInScreen(); |
| 486 } | 486 } |
| 487 | 487 |
| 488 gfx::Rect Widget::GetRestoredBounds() const { | 488 gfx::Rect Widget::GetRestoredBounds() const { |
| 489 return native_widget_->GetRestoredBounds(); | 489 return native_widget_->GetRestoredBounds(); |
| 490 } | 490 } |
| 491 | 491 |
| 492 int Widget::GetRestoredWorkspace() const { |
| 493 return native_widget_->GetRestoredWorkspace(); |
| 494 } |
| 495 |
| 492 void Widget::SetBounds(const gfx::Rect& bounds) { | 496 void Widget::SetBounds(const gfx::Rect& bounds) { |
| 493 native_widget_->SetBounds(bounds); | 497 native_widget_->SetBounds(bounds); |
| 494 } | 498 } |
| 495 | 499 |
| 496 void Widget::SetSize(const gfx::Size& size) { | 500 void Widget::SetSize(const gfx::Size& size) { |
| 497 native_widget_->SetSize(size); | 501 native_widget_->SetSize(size); |
| 498 } | 502 } |
| 499 | 503 |
| 500 void Widget::CenterWindow(const gfx::Size& size) { | 504 void Widget::CenterWindow(const gfx::Size& size) { |
| 501 native_widget_->CenterWindow(size); | 505 native_widget_->CenterWindow(size); |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1103 root->SetSize(new_size); | 1107 root->SetSize(new_size); |
| 1104 | 1108 |
| 1105 NotifyCaretBoundsChanged(GetInputMethod()); | 1109 NotifyCaretBoundsChanged(GetInputMethod()); |
| 1106 SaveWindowPlacementIfInitialized(); | 1110 SaveWindowPlacementIfInitialized(); |
| 1107 | 1111 |
| 1108 FOR_EACH_OBSERVER(WidgetObserver, observers_, OnWidgetBoundsChanged( | 1112 FOR_EACH_OBSERVER(WidgetObserver, observers_, OnWidgetBoundsChanged( |
| 1109 this, | 1113 this, |
| 1110 GetWindowBoundsInScreen())); | 1114 GetWindowBoundsInScreen())); |
| 1111 } | 1115 } |
| 1112 | 1116 |
| 1117 void Widget::OnNativeWidgetWorkspaceChanged(int workspace_id) {} |
| 1118 |
| 1113 void Widget::OnNativeWidgetWindowShowStateChanged() { | 1119 void Widget::OnNativeWidgetWindowShowStateChanged() { |
| 1114 SaveWindowPlacementIfInitialized(); | 1120 SaveWindowPlacementIfInitialized(); |
| 1115 } | 1121 } |
| 1116 | 1122 |
| 1117 void Widget::OnNativeWidgetBeginUserBoundsChange() { | 1123 void Widget::OnNativeWidgetBeginUserBoundsChange() { |
| 1118 widget_delegate_->OnWindowBeginUserBoundsChange(); | 1124 widget_delegate_->OnWindowBeginUserBoundsChange(); |
| 1119 } | 1125 } |
| 1120 | 1126 |
| 1121 void Widget::OnNativeWidgetEndUserBoundsChange() { | 1127 void Widget::OnNativeWidgetEndUserBoundsChange() { |
| 1122 widget_delegate_->OnWindowEndUserBoundsChange(); | 1128 widget_delegate_->OnWindowEndUserBoundsChange(); |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1478 | 1484 |
| 1479 //////////////////////////////////////////////////////////////////////////////// | 1485 //////////////////////////////////////////////////////////////////////////////// |
| 1480 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1486 // internal::NativeWidgetPrivate, NativeWidget implementation: |
| 1481 | 1487 |
| 1482 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1488 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
| 1483 return this; | 1489 return this; |
| 1484 } | 1490 } |
| 1485 | 1491 |
| 1486 } // namespace internal | 1492 } // namespace internal |
| 1487 } // namespace views | 1493 } // namespace views |
| OLD | NEW |