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

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

Issue 2699443004: Modify TrayItemMore to use enabled status (Closed)
Patch Set: Removed non-MD Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: ash/common/system/chromeos/network/tray_network.cc
diff --git a/ash/common/system/chromeos/network/tray_network.cc b/ash/common/system/chromeos/network/tray_network.cc
index 5284453a7239e1d442a5398ea7f569c891a37d96..782e722295a99d3176610036a96530e53f57207c 100644
--- a/ash/common/system/chromeos/network/tray_network.cc
+++ b/ash/common/system/chromeos/network/tray_network.cc
@@ -129,8 +129,8 @@ class NetworkTrayView : public TrayItemView,
class NetworkDefaultView : public TrayItemMore,
public network_icon::AnimationObserver {
public:
- NetworkDefaultView(TrayNetwork* network_tray, bool show_more)
- : TrayItemMore(network_tray, show_more) {
+ explicit NetworkDefaultView(TrayNetwork* network_tray)
+ : TrayItemMore(network_tray) {
Update();
}
@@ -161,8 +161,9 @@ class NetworkDefaultView : public TrayItemMore,
protected:
// TrayItemMore:
- std::unique_ptr<TrayPopupItemStyle> CreateStyle() const override {
- std::unique_ptr<TrayPopupItemStyle> style = TrayItemMore::CreateStyle();
+ std::unique_ptr<TrayPopupItemStyle> HandleCreateStyle() const override {
+ std::unique_ptr<TrayPopupItemStyle> style =
+ TrayItemMore::HandleCreateStyle();
style->set_color_style(GetConnectedNetwork() != nullptr
? TrayPopupItemStyle::ColorStyle::ACTIVE
: TrayPopupItemStyle::ColorStyle::INACTIVE);
@@ -268,7 +269,8 @@ views::View* TrayNetwork::CreateDefaultView(LoginStatus status) {
if (!chromeos::NetworkHandler::IsInitialized())
return NULL;
CHECK(tray_ != NULL);
- default_ = new tray::NetworkDefaultView(this, status != LoginStatus::LOCKED);
+ default_ = new tray::NetworkDefaultView(this);
+ default_->SetEnabled(status != LoginStatus::LOCKED);
return default_;
}

Powered by Google App Engine
This is Rietveld 408576698