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

Side by Side Diff: ash/common/system/tray/tray_background_view.cc

Issue 2639203007: Update SetPaintToLayer to accept LayerType (Closed)
Patch Set: fix comments Created 3 years, 11 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
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 "ash/common/system/tray/tray_background_view.h" 5 #include "ash/common/system/tray/tray_background_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/common/ash_constants.h" 9 #include "ash/common/ash_constants.h"
10 #include "ash/common/material_design/material_design_controller.h" 10 #include "ash/common/material_design/material_design_controller.h"
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 widget_observer_(new TrayWidgetObserver(this)) { 295 widget_observer_(new TrayWidgetObserver(this)) {
296 DCHECK(wm_shelf_); 296 DCHECK(wm_shelf_);
297 set_notify_enter_exit_on_child(true); 297 set_notify_enter_exit_on_child(true);
298 set_ink_drop_base_color(kShelfInkDropBaseColor); 298 set_ink_drop_base_color(kShelfInkDropBaseColor);
299 set_ink_drop_visible_opacity(kShelfInkDropVisibleOpacity); 299 set_ink_drop_visible_opacity(kShelfInkDropVisibleOpacity);
300 300
301 tray_container_ = new TrayContainer(shelf_alignment_); 301 tray_container_ = new TrayContainer(shelf_alignment_);
302 SetContents(tray_container_); 302 SetContents(tray_container_);
303 tray_event_filter_.reset(new TrayEventFilter); 303 tray_event_filter_.reset(new TrayEventFilter);
304 304
305 SetPaintToLayer(true); 305 SetPaintToLayer();
306 layer()->SetFillsBoundsOpaquely(false); 306 layer()->SetFillsBoundsOpaquely(false);
307 // Start the tray items not visible, because visibility changes are animated. 307 // Start the tray items not visible, because visibility changes are animated.
308 views::View::SetVisible(false); 308 views::View::SetVisible(false);
309 } 309 }
310 310
311 TrayBackgroundView::~TrayBackgroundView() { 311 TrayBackgroundView::~TrayBackgroundView() {
312 if (GetWidget()) 312 if (GetWidget())
313 GetWidget()->RemoveObserver(widget_observer_.get()); 313 GetWidget()->RemoveObserver(widget_observer_.get());
314 StopObservingImplicitAnimations(); 314 StopObservingImplicitAnimations();
315 } 315 }
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 } 633 }
634 634
635 gfx::Rect TrayBackgroundView::GetBackgroundBounds() const { 635 gfx::Rect TrayBackgroundView::GetBackgroundBounds() const {
636 gfx::Insets insets = GetBackgroundInsets(); 636 gfx::Insets insets = GetBackgroundInsets();
637 gfx::Rect bounds = GetLocalBounds(); 637 gfx::Rect bounds = GetLocalBounds();
638 bounds.Inset(insets); 638 bounds.Inset(insets);
639 return bounds; 639 return bounds;
640 } 640 }
641 641
642 } // namespace ash 642 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698