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/desktop_aura/desktop_native_widget_aura.h" | 5 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1165 if (content_window_container_) | 1165 if (content_window_container_) |
1166 content_window_container_->SetBounds(new_bounds); | 1166 content_window_container_->SetBounds(new_bounds); |
1167 native_widget_delegate_->OnNativeWidgetSizeChanged(new_bounds.size()); | 1167 native_widget_delegate_->OnNativeWidgetSizeChanged(new_bounds.size()); |
1168 } | 1168 } |
1169 | 1169 |
1170 void DesktopNativeWidgetAura::OnHostWorkspaceChanged( | 1170 void DesktopNativeWidgetAura::OnHostWorkspaceChanged( |
1171 const aura::WindowTreeHost* host) { | 1171 const aura::WindowTreeHost* host) { |
1172 native_widget_delegate_->OnNativeWidgetWorkspaceChanged(); | 1172 native_widget_delegate_->OnNativeWidgetWorkspaceChanged(); |
1173 } | 1173 } |
1174 | 1174 |
1175 void DesktopNativeWidgetAura::OnHostMoved(const aura::WindowTreeHost* host, | 1175 void DesktopNativeWidgetAura::OnHostMovedInPixel( |
1176 const gfx::Point& new_origin) { | 1176 const aura::WindowTreeHost* host, |
1177 TRACE_EVENT1("views", "DesktopNativeWidgetAura::OnHostMoved", | 1177 const gfx::Point& new_origin_in_pixel) { |
1178 "new_origin", new_origin.ToString()); | 1178 TRACE_EVENT1("views", "DesktopNativeWidgetAura::OnHostMovedInPixel", |
| 1179 "new_origin_in_pixel", new_origin_in_pixel.ToString()); |
1179 | 1180 |
1180 native_widget_delegate_->OnNativeWidgetMove(); | 1181 native_widget_delegate_->OnNativeWidgetMove(); |
1181 } | 1182 } |
1182 | 1183 |
1183 //////////////////////////////////////////////////////////////////////////////// | 1184 //////////////////////////////////////////////////////////////////////////////// |
1184 // DesktopNativeWidgetAura, private: | 1185 // DesktopNativeWidgetAura, private: |
1185 | 1186 |
1186 void DesktopNativeWidgetAura::UpdateWindowTransparency() { | 1187 void DesktopNativeWidgetAura::UpdateWindowTransparency() { |
1187 content_window_->SetTransparent( | 1188 content_window_->SetTransparent( |
1188 desktop_window_tree_host_->ShouldWindowContentsBeTransparent()); | 1189 desktop_window_tree_host_->ShouldWindowContentsBeTransparent()); |
1189 // Regardless of transparency or not, this root content window will always | 1190 // Regardless of transparency or not, this root content window will always |
1190 // fill its bounds completely, so set this flag to true to avoid an | 1191 // fill its bounds completely, so set this flag to true to avoid an |
1191 // unecessary clear before update. | 1192 // unecessary clear before update. |
1192 content_window_->SetFillsBoundsCompletely(true); | 1193 content_window_->SetFillsBoundsCompletely(true); |
1193 } | 1194 } |
1194 | 1195 |
1195 void DesktopNativeWidgetAura::RootWindowDestroyed() { | 1196 void DesktopNativeWidgetAura::RootWindowDestroyed() { |
1196 cursor_reference_count_--; | 1197 cursor_reference_count_--; |
1197 if (cursor_reference_count_ == 0) { | 1198 if (cursor_reference_count_ == 0) { |
1198 // We are the last DesktopNativeWidgetAura instance, and we are responsible | 1199 // We are the last DesktopNativeWidgetAura instance, and we are responsible |
1199 // for cleaning up |cursor_manager_|. | 1200 // for cleaning up |cursor_manager_|. |
1200 delete cursor_manager_; | 1201 delete cursor_manager_; |
1201 native_cursor_manager_ = NULL; | 1202 native_cursor_manager_ = NULL; |
1202 cursor_manager_ = NULL; | 1203 cursor_manager_ = NULL; |
1203 } | 1204 } |
1204 } | 1205 } |
1205 | 1206 |
1206 } // namespace views | 1207 } // namespace views |
OLD | NEW |