| 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/controls/native/native_view_host_aura.h" | 5 #include "ui/views/controls/native/native_view_host_aura.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ui/aura/client/aura_constants.h" | 8 #include "ui/aura/client/aura_constants.h" |
| 9 #include "ui/aura/client/focus_client.h" | 9 #include "ui/aura/client/focus_client.h" |
| 10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 RemoveClippingWindow(); | 131 RemoveClippingWindow(); |
| 132 } | 132 } |
| 133 } | 133 } |
| 134 | 134 |
| 135 void NativeViewHostAura::InstallClip(int x, int y, int w, int h) { | 135 void NativeViewHostAura::InstallClip(int x, int y, int w, int h) { |
| 136 clip_rect_.reset( | 136 clip_rect_.reset( |
| 137 new gfx::Rect(host_->ConvertRectToWidget(gfx::Rect(x, y, w, h)))); | 137 new gfx::Rect(host_->ConvertRectToWidget(gfx::Rect(x, y, w, h)))); |
| 138 } | 138 } |
| 139 | 139 |
| 140 bool NativeViewHostAura::HasInstalledClip() { | 140 bool NativeViewHostAura::HasInstalledClip() { |
| 141 return clip_rect_; | 141 return !!clip_rect_; |
| 142 } | 142 } |
| 143 | 143 |
| 144 void NativeViewHostAura::UninstallClip() { | 144 void NativeViewHostAura::UninstallClip() { |
| 145 clip_rect_.reset(); | 145 clip_rect_.reset(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 void NativeViewHostAura::ShowWidget(int x, int y, int w, int h) { | 148 void NativeViewHostAura::ShowWidget(int x, int y, int w, int h) { |
| 149 int width = w; | 149 int width = w; |
| 150 int height = h; | 150 int height = h; |
| 151 if (host_->fast_resize()) { | 151 if (host_->fast_resize()) { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 } else { | 228 } else { |
| 229 clipping_window_.RemoveChild(host_->native_view()); | 229 clipping_window_.RemoveChild(host_->native_view()); |
| 230 } | 230 } |
| 231 host_->native_view()->SetBounds(clipping_window_.bounds()); | 231 host_->native_view()->SetBounds(clipping_window_.bounds()); |
| 232 } | 232 } |
| 233 if (clipping_window_.parent()) | 233 if (clipping_window_.parent()) |
| 234 clipping_window_.parent()->RemoveChild(&clipping_window_); | 234 clipping_window_.parent()->RemoveChild(&clipping_window_); |
| 235 } | 235 } |
| 236 | 236 |
| 237 } // namespace views | 237 } // namespace views |
| OLD | NEW |