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/bubble/tray_bubble_view.h" | 5 #include "ui/views/bubble/tray_bubble_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "third_party/skia/include/core/SkCanvas.h" | 9 #include "third_party/skia/include/core/SkCanvas.h" |
10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 // alternate solutions if the TrayBubbleView is needed there in the future. | 177 // alternate solutions if the TrayBubbleView is needed there in the future. |
178 class TrayBubbleContentMask : public ui::LayerDelegate { | 178 class TrayBubbleContentMask : public ui::LayerDelegate { |
179 public: | 179 public: |
180 explicit TrayBubbleContentMask(int corner_radius); | 180 explicit TrayBubbleContentMask(int corner_radius); |
181 virtual ~TrayBubbleContentMask(); | 181 virtual ~TrayBubbleContentMask(); |
182 | 182 |
183 ui::Layer* layer() { return &layer_; } | 183 ui::Layer* layer() { return &layer_; } |
184 | 184 |
185 // Overridden from LayerDelegate. | 185 // Overridden from LayerDelegate. |
186 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE; | 186 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE; |
| 187 virtual void OnDelegatedFrameDamage( |
| 188 const gfx::Rect& damage_rect_in_dip) OVERRIDE {} |
187 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; | 189 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; |
188 virtual base::Closure PrepareForLayerBoundsChange() OVERRIDE; | 190 virtual base::Closure PrepareForLayerBoundsChange() OVERRIDE; |
189 | 191 |
190 private: | 192 private: |
191 ui::Layer layer_; | 193 ui::Layer layer_; |
192 SkScalar corner_radius_; | 194 SkScalar corner_radius_; |
193 | 195 |
194 DISALLOW_COPY_AND_ASSIGN(TrayBubbleContentMask); | 196 DISALLOW_COPY_AND_ASSIGN(TrayBubbleContentMask); |
195 }; | 197 }; |
196 | 198 |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 void TrayBubbleView::ViewHierarchyChanged( | 501 void TrayBubbleView::ViewHierarchyChanged( |
500 const ViewHierarchyChangedDetails& details) { | 502 const ViewHierarchyChangedDetails& details) { |
501 if (details.is_add && details.child == this) { | 503 if (details.is_add && details.child == this) { |
502 details.parent->SetPaintToLayer(true); | 504 details.parent->SetPaintToLayer(true); |
503 details.parent->SetFillsBoundsOpaquely(true); | 505 details.parent->SetFillsBoundsOpaquely(true); |
504 details.parent->layer()->SetMasksToBounds(true); | 506 details.parent->layer()->SetMasksToBounds(true); |
505 } | 507 } |
506 } | 508 } |
507 | 509 |
508 } // namespace views | 510 } // namespace views |
OLD | NEW |