| Index: ash/common/system/chromeos/network/network_list_md.cc
|
| diff --git a/ash/common/system/chromeos/network/network_list_md.cc b/ash/common/system/chromeos/network/network_list_md.cc
|
| index 6d1fb9f7189dea4a10e5e33b8fe3b20e2954a0ce..615d3b42f90a468bab87e9996dcf497776daad63 100644
|
| --- a/ash/common/system/chromeos/network/network_list_md.cc
|
| +++ b/ash/common/system/chromeos/network/network_list_md.cc
|
| @@ -10,6 +10,7 @@
|
| #include "ash/common/system/chromeos/network/network_icon_animation.h"
|
| #include "ash/common/system/chromeos/network/network_list_delegate.h"
|
| #include "ash/common/system/tray/system_menu_button.h"
|
| +#include "ash/common/system/tray/system_menu_toggle_button.h"
|
| #include "ash/common/system/tray/tray_constants.h"
|
| #include "ash/common/system/tray/tray_popup_utils.h"
|
| #include "base/memory/ptr_util.h"
|
| @@ -30,7 +31,6 @@
|
| #include "ui/gfx/paint_vector_icon.h"
|
| #include "ui/gfx/vector_icons_public.h"
|
| #include "ui/views/border.h"
|
| -#include "ui/views/controls/button/toggle_button.h"
|
| #include "ui/views/controls/label.h"
|
| #include "ui/views/layout/box_layout.h"
|
| #include "ui/views/layout/fill_layout.h"
|
| @@ -51,8 +51,6 @@ namespace {
|
| const int kSectionHeaderRowSize = 48;
|
| const int kSectionHeaderRowVerticalInset = 4;
|
| const int kSectionHeaderRowLeftInset = 18;
|
| -const int kSectionHeaderRowRightInset = 14;
|
| -const int kSectionHeaderRowChildSpacing = 14;
|
|
|
| bool IsProhibitedByPolicy(const chromeos::NetworkState* network) {
|
| if (!NetworkTypePattern::WiFi().MatchesType(network->type()))
|
| @@ -134,14 +132,14 @@ class NetworkListViewMd::SectionHeaderRowView : public views::View,
|
| // https://crbug.com/614453.
|
| TrayPopupUtils::ConfigureAsStickyHeader(this);
|
| container_ = new views::View;
|
| - container_->SetBorder(views::CreateEmptyBorder(
|
| - 0, kSectionHeaderRowLeftInset, 0, kSectionHeaderRowRightInset));
|
| + container_->SetBorder(
|
| + views::CreateEmptyBorder(0, kSectionHeaderRowLeftInset, 0, 0));
|
| views::FillLayout* layout = new views::FillLayout;
|
| SetLayoutManager(layout);
|
| AddChildView(container_);
|
|
|
| - views::BoxLayout* container_layout = new views::BoxLayout(
|
| - views::BoxLayout::kHorizontal, 0, 0, kSectionHeaderRowChildSpacing);
|
| + views::BoxLayout* container_layout =
|
| + new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0);
|
| container_layout->set_cross_axis_alignment(
|
| views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER);
|
| container_->SetLayoutManager(container_layout);
|
| @@ -160,12 +158,8 @@ class NetworkListViewMd::SectionHeaderRowView : public views::View,
|
| }
|
|
|
| void AddToggleButton(bool enabled) {
|
| - toggle_ = new views::ToggleButton(this);
|
| - toggle_->SetAccessibleName(l10n_util::GetStringUTF16(title_id_));
|
| + toggle_ = new SystemMenuToggleButton(this, title_id_);
|
| toggle_->SetIsOn(enabled, false);
|
| - // TODO(varkha): Implement focus painter for toggle. See
|
| - // https://crbug.com/652677 for context.
|
| - toggle_->SetFocusForPlatform();
|
| container_->AddChildView(toggle_);
|
| }
|
|
|
| @@ -178,7 +172,7 @@ class NetworkListViewMd::SectionHeaderRowView : public views::View,
|
| views::View* container_;
|
|
|
| // ToggleButton to toggle section on or off.
|
| - views::ToggleButton* toggle_;
|
| + SystemMenuToggleButton* toggle_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(SectionHeaderRowView);
|
| };
|
|
|