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

Unified Diff: ash/common/system/chromeos/network/network_list_md.cc

Issue 2509943002: NO LONGER FOR REVIEW - [ash-md] Implements a square focus rectangle for ToggleButton (Closed)
Patch Set: [ash-md] Implements a square focus rectangle for ToggleButton (rebased) Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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..03cd58be68fc730c06912c736c69dd929c509e85 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"
@@ -160,12 +160,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 +174,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);
};

Powered by Google App Engine
This is Rietveld 408576698