OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/special_popup_row.h" | 5 #include "ash/common/system/tray/special_popup_row.h" |
6 | 6 |
7 #include "ash/common/system/tray/hover_highlight_view.h" | 7 #include "ash/common/system/tray/hover_highlight_view.h" |
8 #include "ash/common/system/tray/throbber_view.h" | 8 #include "ash/common/system/tray/throbber_view.h" |
9 #include "ash/common/system/tray/tray_constants.h" | 9 #include "ash/common/system/tray/tray_constants.h" |
10 #include "ash/common/system/tray/tray_popup_header_button.h" | 10 #include "ash/common/system/tray/tray_popup_header_button.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 views::View* CreatePopupHeaderButtonsContainer() { | 32 views::View* CreatePopupHeaderButtonsContainer() { |
33 views::View* view = new views::View; | 33 views::View* view = new views::View; |
34 view->SetLayoutManager( | 34 view->SetLayoutManager( |
35 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0)); | 35 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0)); |
36 view->SetBorder(views::Border::CreateEmptyBorder(4, 0, 4, 5)); | 36 view->SetBorder(views::Border::CreateEmptyBorder(4, 0, 4, 5)); |
37 return view; | 37 return view; |
38 } | 38 } |
39 | 39 |
40 } // namespace | 40 } // namespace |
41 | 41 |
42 SpecialPopupRow::SpecialPopupRow() | 42 SpecialPopupRow::SpecialPopupRow() : content_(NULL), button_container_(NULL) { |
43 : content_(NULL), | 43 set_background( |
44 button_container_(NULL) { | 44 views::Background::CreateSolidBackground(kHeaderBackgroundColor)); |
45 set_background(views::Background::CreateSolidBackground( | 45 SetBorder(views::Border::CreateSolidSidedBorder(kBorderHeight, 0, 0, 0, |
46 kHeaderBackgroundColor)); | 46 kBorderColor)); |
47 SetBorder(views::Border::CreateSolidSidedBorder( | |
48 kBorderHeight, 0, 0, 0, kBorderColor)); | |
49 SetLayoutManager( | 47 SetLayoutManager( |
50 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0)); | 48 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0)); |
51 } | 49 } |
52 | 50 |
53 SpecialPopupRow::~SpecialPopupRow() { | 51 SpecialPopupRow::~SpecialPopupRow() {} |
54 } | |
55 | 52 |
56 void SpecialPopupRow::SetTextLabel(int string_id, ViewClickListener* listener) { | 53 void SpecialPopupRow::SetTextLabel(int string_id, ViewClickListener* listener) { |
57 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 54 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
58 HoverHighlightView* container = new HoverHighlightView(listener); | 55 HoverHighlightView* container = new HoverHighlightView(listener); |
59 container->SetLayoutManager(new | 56 container->SetLayoutManager(new views::BoxLayout( |
60 views::BoxLayout(views::BoxLayout::kHorizontal, 0, 3, kIconPaddingLeft)); | 57 views::BoxLayout::kHorizontal, 0, 3, kIconPaddingLeft)); |
61 | 58 |
62 container->set_highlight_color(SkColorSetARGB(0, 0, 0, 0)); | 59 container->set_highlight_color(SkColorSetARGB(0, 0, 0, 0)); |
63 container->set_default_color(SkColorSetARGB(0, 0, 0, 0)); | 60 container->set_default_color(SkColorSetARGB(0, 0, 0, 0)); |
64 container->set_text_highlight_color(kHeaderTextColorHover); | 61 container->set_text_highlight_color(kHeaderTextColorHover); |
65 container->set_text_default_color(kHeaderTextColorNormal); | 62 container->set_text_default_color(kHeaderTextColorNormal); |
66 | 63 |
67 container->AddIconAndLabel( | 64 container->AddIconAndLabel( |
68 *rb.GetImageNamed(IDR_AURA_UBER_TRAY_LESS).ToImageSkia(), | 65 *rb.GetImageNamed(IDR_AURA_UBER_TRAY_LESS).ToImageSkia(), |
69 rb.GetLocalizedString(string_id), true /* highlight */); | 66 rb.GetLocalizedString(string_id), true /* highlight */); |
70 | 67 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 container_bounds.ClampToCenteredSize(bounds.size()); | 125 container_bounds.ClampToCenteredSize(bounds.size()); |
129 container_bounds.set_x(content_bounds.width() - container_bounds.width()); | 126 container_bounds.set_x(content_bounds.width() - container_bounds.width()); |
130 button_container_->SetBoundsRect(container_bounds); | 127 button_container_->SetBoundsRect(container_bounds); |
131 | 128 |
132 bounds = content_->bounds(); | 129 bounds = content_->bounds(); |
133 bounds.set_width(button_container_->x()); | 130 bounds.set_width(button_container_->x()); |
134 content_->SetBoundsRect(bounds); | 131 content_->SetBoundsRect(bounds); |
135 } | 132 } |
136 | 133 |
137 } // namespace ash | 134 } // namespace ash |
OLD | NEW |