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

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

Issue 2365523002: Materialized the font/icon color for some default rows in the system menu. (Closed)
Patch Set: Applied TrayPopupItemStyle to Network, SMS, Tracing, OS Update. Created 4 years, 3 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 d9a859de091d1b2720ec2634bc975020cef292ff..32c52ed95120099cabf595a24ca172db6770f5a7 100644
--- a/ash/common/system/chromeos/network/tray_network.cc
+++ b/ash/common/system/chromeos/network/tray_network.cc
@@ -13,6 +13,7 @@
#include "ash/common/system/tray/tray_constants.h"
#include "ash/common/system/tray/tray_item_more.h"
#include "ash/common/system/tray/tray_item_view.h"
+#include "ash/common/system/tray/tray_popup_item_style.h"
#include "ash/common/system/tray/tray_utils.h"
#include "ash/common/wm_shell.h"
#include "base/command_line.h"
@@ -97,13 +98,13 @@ class NetworkTrayView : public TrayItemView,
Layout();
}
- // views::View override.
+ // views::View:
void GetAccessibleState(ui::AXViewState* state) override {
state->name = connection_status_string_;
state->role = ui::AX_ROLE_BUTTON;
}
- // ui::network_icon::AnimationObserver
+ // ui::network_icon::AnimationObserver:
void NetworkIconChanged() override { UpdateNetworkStateHandlerIcon(); }
private:
@@ -150,6 +151,8 @@ class NetworkDefaultView : public TrayItemMore,
gfx::ImageSkia image;
base::string16 label;
bool animating = false;
+ // TODO(bruthig): Update the image to use the proper color. See
+ // https://crbug.com/632027.
ui::network_icon::GetDefaultNetworkImageAndLabel(
ui::network_icon::ICON_TYPE_DEFAULT_VIEW, &image, &label, &animating);
if (animating)
@@ -165,6 +168,15 @@ class NetworkDefaultView : public TrayItemMore,
// ui::network_icon::AnimationObserver
void NetworkIconChanged() override { Update(); }
+ protected:
+ // TrayItemMore:
+ std::unique_ptr<TrayPopupItemStyle> CreateStyle() const override {
+ // TODO(bruthig): Apply different ColorStyles based on network state. See
+ // https://crbug.com/632027.
+ return base::MakeUnique<TrayPopupItemStyle>(
+ GetNativeTheme(), TrayPopupItemStyle::FontStyle::DEFAULT_VIEW_LABEL);
+ }
+
private:
DISALLOW_COPY_AND_ASSIGN(NetworkDefaultView);
};

Powered by Google App Engine
This is Rietveld 408576698