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

Side by Side Diff: ash/system/network/vpn_list_view.cc

Issue 2831023003: Refactor AddScrollListItem() in system menu detailed views (Closed)
Patch Set: Rebased Created 3 years, 8 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 | « ash/system/network/network_list.cc ('k') | ash/system/tray/hover_highlight_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/network/vpn_list_view.h" 5 #include "ash/system/network/vpn_list_view.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // A list entry that represents a VPN provider. 81 // A list entry that represents a VPN provider.
82 class VPNListProviderEntry : public views::ButtonListener, public views::View { 82 class VPNListProviderEntry : public views::ButtonListener, public views::View {
83 public: 83 public:
84 VPNListProviderEntry(ViewClickListener* parent, 84 VPNListProviderEntry(ViewClickListener* parent,
85 bool top_item, 85 bool top_item,
86 const std::string& name, 86 const std::string& name,
87 int button_accessible_name_id) 87 int button_accessible_name_id)
88 : parent_(parent) { 88 : parent_(parent) {
89 TrayPopupUtils::ConfigureAsStickyHeader(this); 89 TrayPopupUtils::ConfigureAsStickyHeader(this);
90 SetLayoutManager(new views::FillLayout); 90 SetLayoutManager(new views::FillLayout);
91 TriView* tri_view = TrayPopupUtils::CreateSubHeaderRowView(); 91 TriView* tri_view = TrayPopupUtils::CreateSubHeaderRowView(false);
92 AddChildView(tri_view); 92 AddChildView(tri_view);
93 93
94 views::Label* label = TrayPopupUtils::CreateDefaultLabel(); 94 views::Label* label = TrayPopupUtils::CreateDefaultLabel();
95 TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::SUB_HEADER); 95 TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::SUB_HEADER);
96 style.SetupLabel(label); 96 style.SetupLabel(label);
97 label->SetText(base::ASCIIToUTF16(name)); 97 label->SetText(base::ASCIIToUTF16(name));
98 tri_view->AddView(TriView::Container::CENTER, label); 98 tri_view->AddView(TriView::Container::CENTER, label);
99 99
100 const SkColor image_color = GetNativeTheme()->GetSystemColor( 100 const SkColor image_color = GetNativeTheme()->GetSystemColor(
101 ui::NativeTheme::kColorId_ProminentButtonColor); 101 ui::NativeTheme::kColorId_ProminentButtonColor);
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 } 413 }
414 } 414 }
415 415
416 // Add providers without any configured networks, in the order that the 416 // Add providers without any configured networks, in the order that the
417 // providers were returned by the extensions system. 417 // providers were returned by the extensions system.
418 for (const VPNProvider& provider : providers) 418 for (const VPNProvider& provider : providers)
419 AddProviderAndNetworks(provider, networks); 419 AddProviderAndNetworks(provider, networks);
420 } 420 }
421 421
422 } // namespace ash 422 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/network/network_list.cc ('k') | ash/system/tray/hover_highlight_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698