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 "ash/system/chromeos/network/network_list_detailed_view_base.h" | 5 #include "ash/system/chromeos/network/network_list_detailed_view_base.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "ash/system/tray/system_tray.h" | 9 #include "ash/system/tray/system_tray.h" |
10 #include "ash/system/tray/system_tray_delegate.h" | 10 #include "ash/system/tray/system_tray_delegate.h" |
11 #include "ash/system/tray/system_tray_item.h" | 11 #include "ash/system/tray/system_tray_item.h" |
12 #include "ash/system/tray/tray_constants.h" | 12 #include "ash/system/tray/tray_constants.h" |
13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
14 #include "grit/ash_resources.h" | 14 #include "grit/ash_resources.h" |
15 #include "grit/ash_strings.h" | 15 #include "grit/ash_strings.h" |
16 #include "ui/aura/window.h" | 16 #include "ui/aura/window.h" |
17 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
18 #include "ui/base/resource/resource_bundle.h" | 18 #include "ui/base/resource/resource_bundle.h" |
19 #include "ui/views/bubble/bubble_delegate.h" | 19 #include "ui/views/bubble/bubble_delegate.h" |
20 #include "ui/views/controls/label.h" | 20 #include "ui/views/controls/label.h" |
21 #include "ui/views/layout/box_layout.h" | 21 #include "ui/views/layout/box_layout.h" |
22 #include "ui/views/layout/fill_layout.h" | 22 #include "ui/views/layout/fill_layout.h" |
23 #include "ui/views/widget/widget.h" | 23 #include "ui/views/widget/widget.h" |
24 | 24 |
25 namespace { | 25 namespace { |
26 const int kPaddingAroundBottomRow = 5; | |
27 | 26 |
28 // Create a label with the font size and color used in the network info bubble. | 27 // Create a label with the font size and color used in the network info bubble. |
29 views::Label* CreateInfoBubbleLabel(const string16& text) { | 28 views::Label* CreateInfoBubbleLabel(const string16& text) { |
30 const SkColor text_color = SkColorSetARGB(127, 0, 0, 0); | 29 const SkColor text_color = SkColorSetARGB(127, 0, 0, 0); |
31 views::Label* label = new views::Label(text); | 30 views::Label* label = new views::Label(text); |
32 label->SetFont(label->font().DeriveFont(-1)); | 31 label->SetFont(label->font().DeriveFont(-1)); |
33 label->SetEnabledColor(text_color); | 32 label->SetEnabledColor(text_color); |
34 return label; | 33 return label; |
35 } | 34 } |
36 | 35 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 void NetworkListDetailedViewBase::AppendHeaderEntry(int header_string_id) { | 131 void NetworkListDetailedViewBase::AppendHeaderEntry(int header_string_id) { |
133 CreateSpecialRow(header_string_id, this); | 132 CreateSpecialRow(header_string_id, this); |
134 } | 133 } |
135 | 134 |
136 void NetworkListDetailedViewBase::AppendNetworkExtra() { | 135 void NetworkListDetailedViewBase::AppendNetworkExtra() { |
137 if (login_ == user::LOGGED_IN_LOCKED) | 136 if (login_ == user::LOGGED_IN_LOCKED) |
138 return; | 137 return; |
139 | 138 |
140 views::BoxLayout* layout = new | 139 views::BoxLayout* layout = new |
141 views::BoxLayout(views::BoxLayout::kHorizontal, | 140 views::BoxLayout(views::BoxLayout::kHorizontal, |
142 kPaddingAroundBottomRow, | 141 kTrayMenuBottomRowPadding, |
143 kPaddingAroundBottomRow, | 142 kTrayMenuBottomRowPadding, |
144 -1); | 143 kTrayMenuBottomRowPaddingBetweenItems); |
145 layout->set_spread_blank_space(true); | 144 layout->set_spread_blank_space(true); |
146 views::View* bottom_row = new View(); | 145 views::View* bottom_row = new View(); |
147 bottom_row->SetLayoutManager(layout); | 146 bottom_row->SetLayoutManager(layout); |
148 | 147 |
149 AppendCustomButtonsToBottomRow(bottom_row); | 148 AppendCustomButtonsToBottomRow(bottom_row); |
150 | 149 |
151 CreateSettingsEntry(); | 150 CreateSettingsEntry(); |
152 DCHECK(settings_ || proxy_settings_); | 151 DCHECK(settings_ || proxy_settings_); |
153 bottom_row->AddChildView(settings_ ? settings_ : proxy_settings_); | 152 bottom_row->AddChildView(settings_ ? settings_ : proxy_settings_); |
154 | 153 |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 return false; | 383 return false; |
385 info_bubble_->GetWidget()->Close(); | 384 info_bubble_->GetWidget()->Close(); |
386 info_bubble_ = NULL; | 385 info_bubble_ = NULL; |
387 return true; | 386 return true; |
388 } | 387 } |
389 | 388 |
390 } // namespace tray | 389 } // namespace tray |
391 | 390 |
392 } // namespace internal | 391 } // namespace internal |
393 } // namespace ash | 392 } // namespace ash |
OLD | NEW |