Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: ui/views/bubble/tray_bubble_view.cc

Issue 2908073003: Ensure that mask layer is of the same size as the owning layer. (Closed)
Patch Set: style change Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/views/bubble/tray_bubble_view.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/macros.h" 9 #include "base/macros.h"
10 #include "cc/paint/paint_flags.h" 10 #include "cc/paint/paint_flags.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 } 258 }
259 259
260 gfx::Insets TrayBubbleView::GetBorderInsets() const { 260 gfx::Insets TrayBubbleView::GetBorderInsets() const {
261 return bubble_border_->GetInsets(); 261 return bubble_border_->GetInsets();
262 } 262 }
263 263
264 int TrayBubbleView::GetDialogButtons() const { 264 int TrayBubbleView::GetDialogButtons() const {
265 return ui::DIALOG_BUTTON_NONE; 265 return ui::DIALOG_BUTTON_NONE;
266 } 266 }
267 267
268 void TrayBubbleView::SizeToContents() {
269 BubbleDialogDelegateView::SizeToContents();
270 bubble_content_mask_->layer()->SetBounds(layer()->bounds());
271 }
272
268 void TrayBubbleView::OnBeforeBubbleWidgetInit(Widget::InitParams* params, 273 void TrayBubbleView::OnBeforeBubbleWidgetInit(Widget::InitParams* params,
269 Widget* bubble_widget) const { 274 Widget* bubble_widget) const {
270 // Apply a WM-provided shadow (see ui/wm/core/). 275 // Apply a WM-provided shadow (see ui/wm/core/).
271 params->shadow_type = Widget::InitParams::SHADOW_TYPE_DROP; 276 params->shadow_type = Widget::InitParams::SHADOW_TYPE_DROP;
272 params->shadow_elevation = wm::ShadowElevation::LARGE; 277 params->shadow_elevation = wm::ShadowElevation::LARGE;
273 } 278 }
274 279
275 void TrayBubbleView::OnWidgetClosing(Widget* widget) { 280 void TrayBubbleView::OnWidgetClosing(Widget* widget) {
276 BubbleDialogDelegateView::OnWidgetClosing(widget); 281 BubbleDialogDelegateView::OnWidgetClosing(widget);
277 --g_current_tray_bubble_showing_count_; 282 --g_current_tray_bubble_showing_count_;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 382
378 void TrayBubbleView::ViewHierarchyChanged( 383 void TrayBubbleView::ViewHierarchyChanged(
379 const ViewHierarchyChangedDetails& details) { 384 const ViewHierarchyChangedDetails& details) {
380 if (details.is_add && details.child == this) { 385 if (details.is_add && details.child == this) {
381 details.parent->SetPaintToLayer(); 386 details.parent->SetPaintToLayer();
382 details.parent->layer()->SetMasksToBounds(true); 387 details.parent->layer()->SetMasksToBounds(true);
383 } 388 }
384 } 389 }
385 390
386 } // namespace views 391 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/bubble/tray_bubble_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698