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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 native_widget(nullptr), | 132 native_widget(nullptr), |
133 desktop_window_tree_host(nullptr), | 133 desktop_window_tree_host(nullptr), |
134 layer_type(ui::LAYER_TEXTURED), | 134 layer_type(ui::LAYER_TEXTURED), |
135 context(nullptr), | 135 context(nullptr), |
136 force_show_in_taskbar(false), | 136 force_show_in_taskbar(false), |
137 force_software_compositing(false) { | 137 force_software_compositing(false) {} |
138 } | |
139 | 138 |
140 Widget::InitParams::InitParams(const InitParams& other) = default; | 139 Widget::InitParams::InitParams(const InitParams& other) = default; |
141 | 140 |
142 Widget::InitParams::~InitParams() { | 141 Widget::InitParams::~InitParams() { |
143 } | 142 } |
144 | 143 |
145 //////////////////////////////////////////////////////////////////////////////// | 144 //////////////////////////////////////////////////////////////////////////////// |
146 // Widget, public: | 145 // Widget, public: |
147 | 146 |
148 Widget::Widget() | 147 Widget::Widget() |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 } | 481 } |
483 | 482 |
484 gfx::Rect Widget::GetClientAreaBoundsInScreen() const { | 483 gfx::Rect Widget::GetClientAreaBoundsInScreen() const { |
485 return native_widget_->GetClientAreaBoundsInScreen(); | 484 return native_widget_->GetClientAreaBoundsInScreen(); |
486 } | 485 } |
487 | 486 |
488 gfx::Rect Widget::GetRestoredBounds() const { | 487 gfx::Rect Widget::GetRestoredBounds() const { |
489 return native_widget_->GetRestoredBounds(); | 488 return native_widget_->GetRestoredBounds(); |
490 } | 489 } |
491 | 490 |
| 491 std::string Widget::GetWorkspace() const { |
| 492 return native_widget_->GetWorkspace(); |
| 493 } |
| 494 |
492 void Widget::SetBounds(const gfx::Rect& bounds) { | 495 void Widget::SetBounds(const gfx::Rect& bounds) { |
493 native_widget_->SetBounds(bounds); | 496 native_widget_->SetBounds(bounds); |
494 } | 497 } |
495 | 498 |
496 void Widget::SetSize(const gfx::Size& size) { | 499 void Widget::SetSize(const gfx::Size& size) { |
497 native_widget_->SetSize(size); | 500 native_widget_->SetSize(size); |
498 } | 501 } |
499 | 502 |
500 void Widget::CenterWindow(const gfx::Size& size) { | 503 void Widget::CenterWindow(const gfx::Size& size) { |
501 native_widget_->CenterWindow(size); | 504 native_widget_->CenterWindow(size); |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 root->SetSize(new_size); | 1106 root->SetSize(new_size); |
1104 | 1107 |
1105 NotifyCaretBoundsChanged(GetInputMethod()); | 1108 NotifyCaretBoundsChanged(GetInputMethod()); |
1106 SaveWindowPlacementIfInitialized(); | 1109 SaveWindowPlacementIfInitialized(); |
1107 | 1110 |
1108 FOR_EACH_OBSERVER(WidgetObserver, observers_, OnWidgetBoundsChanged( | 1111 FOR_EACH_OBSERVER(WidgetObserver, observers_, OnWidgetBoundsChanged( |
1109 this, | 1112 this, |
1110 GetWindowBoundsInScreen())); | 1113 GetWindowBoundsInScreen())); |
1111 } | 1114 } |
1112 | 1115 |
| 1116 void Widget::OnNativeWidgetWorkspaceChanged() {} |
| 1117 |
1113 void Widget::OnNativeWidgetWindowShowStateChanged() { | 1118 void Widget::OnNativeWidgetWindowShowStateChanged() { |
1114 SaveWindowPlacementIfInitialized(); | 1119 SaveWindowPlacementIfInitialized(); |
1115 } | 1120 } |
1116 | 1121 |
1117 void Widget::OnNativeWidgetBeginUserBoundsChange() { | 1122 void Widget::OnNativeWidgetBeginUserBoundsChange() { |
1118 widget_delegate_->OnWindowBeginUserBoundsChange(); | 1123 widget_delegate_->OnWindowBeginUserBoundsChange(); |
1119 } | 1124 } |
1120 | 1125 |
1121 void Widget::OnNativeWidgetEndUserBoundsChange() { | 1126 void Widget::OnNativeWidgetEndUserBoundsChange() { |
1122 widget_delegate_->OnWindowEndUserBoundsChange(); | 1127 widget_delegate_->OnWindowEndUserBoundsChange(); |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1478 | 1483 |
1479 //////////////////////////////////////////////////////////////////////////////// | 1484 //////////////////////////////////////////////////////////////////////////////// |
1480 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1485 // internal::NativeWidgetPrivate, NativeWidget implementation: |
1481 | 1486 |
1482 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1487 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
1483 return this; | 1488 return this; |
1484 } | 1489 } |
1485 | 1490 |
1486 } // namespace internal | 1491 } // namespace internal |
1487 } // namespace views | 1492 } // namespace views |
OLD | NEW |