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

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

Issue 10535112: Prepare status area to support multiple trays. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 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 | Annotate | Revision Log
« no previous file with comments | « ash/system/tray/tray_background_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 "ash/system/tray/tray_background_view.h" 5 #include "ash/system/tray/tray_background_view.h"
6 6
7 #include "ash/launcher/background_animator.h" 7 #include "ash/launcher/background_animator.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell_window_ids.h" 9 #include "ash/shell_window_ids.h"
10 #include "ash/system/tray/tray_constants.h" 10 #include "ash/system/tray/tray_constants.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 int alpha_; 48 int alpha_;
49 49
50 DISALLOW_COPY_AND_ASSIGN(TrayBackground); 50 DISALLOW_COPY_AND_ASSIGN(TrayBackground);
51 }; 51 };
52 52
53 //////////////////////////////////////////////////////////////////////////////// 53 ////////////////////////////////////////////////////////////////////////////////
54 // TrayBackgroundView 54 // TrayBackgroundView
55 55
56 TrayBackgroundView::TrayBackgroundView() 56 TrayBackgroundView::TrayBackgroundView()
57 : background_(NULL), 57 : shelf_alignment_(SHELF_ALIGNMENT_BOTTOM),
58 ALLOW_THIS_IN_INITIALIZER_LIST(hide_background_animator_( 58 background_(NULL),
59 this, 0, kTrayBackgroundAlpha)), 59 ALLOW_THIS_IN_INITIALIZER_LIST(hide_background_animator_(
60 ALLOW_THIS_IN_INITIALIZER_LIST(hover_background_animator_( 60 this, 0, kTrayBackgroundAlpha)),
61 this, 0, kTrayBackgroundHoverAlpha - kTrayBackgroundAlpha)) { 61 ALLOW_THIS_IN_INITIALIZER_LIST(hover_background_animator_(
62 this, 0, kTrayBackgroundHoverAlpha - kTrayBackgroundAlpha)) {
62 set_border(views::Border::CreateEmptyBorder(0, 0, 63 set_border(views::Border::CreateEmptyBorder(0, 0,
63 kPaddingFromBottomOfScreenBottomAlignment, 64 kPaddingFromBottomOfScreenBottomAlignment,
64 kPaddingFromRightEdgeOfScreenBottomAlignment)); 65 kPaddingFromRightEdgeOfScreenBottomAlignment));
65 set_notify_enter_exit_on_child(true); 66 set_notify_enter_exit_on_child(true);
66 67
67 // Initially we want to paint the background, but without the hover effect. 68 // Initially we want to paint the background, but without the hover effect.
68 SetPaintsBackground(true, internal::BackgroundAnimator::CHANGE_IMMEDIATE); 69 SetPaintsBackground(true, internal::BackgroundAnimator::CHANGE_IMMEDIATE);
69 hover_background_animator_.SetPaintsBackground(false, 70 hover_background_animator_.SetPaintsBackground(false,
70 internal::BackgroundAnimator::CHANGE_IMMEDIATE); 71 internal::BackgroundAnimator::CHANGE_IMMEDIATE);
71 } 72 }
(...skipping 30 matching lines...) Expand all
102 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)); 103 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
103 AddChildView(contents); 104 AddChildView(contents);
104 } 105 }
105 106
106 void TrayBackgroundView::SetPaintsBackground( 107 void TrayBackgroundView::SetPaintsBackground(
107 bool value, 108 bool value,
108 internal::BackgroundAnimator::ChangeType change_type) { 109 internal::BackgroundAnimator::ChangeType change_type) {
109 hide_background_animator_.SetPaintsBackground(value, change_type); 110 hide_background_animator_.SetPaintsBackground(value, change_type);
110 } 111 }
111 112
113 void TrayBackgroundView::SetShelfAlignment(ShelfAlignment alignment) {
114 shelf_alignment_ = alignment;
115 }
116
112 } // namespace internal 117 } // namespace internal
113 } // namespace ash 118 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray/tray_background_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698