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 "ui/views/controls/native/native_view_host.h" | 5 #include "ui/views/controls/native/native_view_host.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ui/gfx/canvas.h" | 8 #include "ui/gfx/canvas.h" |
9 #include "ui/views/controls/native/native_view_host_wrapper.h" | 9 #include "ui/views/controls/native/native_view_host_wrapper.h" |
10 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 OnPaintBackground(canvas); | 118 OnPaintBackground(canvas); |
119 | 119 |
120 // The area behind our window is black, so during a fast resize (where our | 120 // The area behind our window is black, so during a fast resize (where our |
121 // content doesn't draw over the full size of our native view, and the native | 121 // content doesn't draw over the full size of our native view, and the native |
122 // view background color doesn't show up), we need to cover that blackness | 122 // view background color doesn't show up), we need to cover that blackness |
123 // with something so that fast resizes don't result in black flash. | 123 // with something so that fast resizes don't result in black flash. |
124 // | 124 // |
125 // It would be nice if this used some approximation of the page's | 125 // It would be nice if this used some approximation of the page's |
126 // current background color. | 126 // current background color. |
127 if (native_wrapper_->HasInstalledClip()) | 127 if (native_wrapper_->HasInstalledClip()) |
128 canvas->FillRect(SK_ColorWHITE, GetLocalBounds()); | 128 canvas->FillRect(GetLocalBounds(), SK_ColorWHITE); |
129 } | 129 } |
130 | 130 |
131 void NativeViewHost::VisibilityChanged(View* starting_from, bool is_visible) { | 131 void NativeViewHost::VisibilityChanged(View* starting_from, bool is_visible) { |
132 Layout(); | 132 Layout(); |
133 } | 133 } |
134 | 134 |
135 bool NativeViewHost::NeedsNotificationWhenVisibleBoundsChange() const { | 135 bool NativeViewHost::NeedsNotificationWhenVisibleBoundsChange() const { |
136 // The native widget is placed relative to the root. As such, we need to | 136 // The native widget is placed relative to the root. As such, we need to |
137 // know when the position of any ancestor changes, or our visibility relative | 137 // know when the position of any ancestor changes, or our visibility relative |
138 // to other views changed as it'll effect our position relative to the root. | 138 // to other views changed as it'll effect our position relative to the root. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 // NativeViewHost, private: | 179 // NativeViewHost, private: |
180 | 180 |
181 void NativeViewHost::Detach(bool destroyed) { | 181 void NativeViewHost::Detach(bool destroyed) { |
182 if (native_view_) { | 182 if (native_view_) { |
183 native_wrapper_->NativeViewDetaching(destroyed); | 183 native_wrapper_->NativeViewDetaching(destroyed); |
184 native_view_ = NULL; | 184 native_view_ = NULL; |
185 } | 185 } |
186 } | 186 } |
187 | 187 |
188 } // namespace views | 188 } // namespace views |
OLD | NEW |