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

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

Issue 2455183002: Simplify layout of tray items and fix spacing for MD. (Closed)
Patch Set: tda review Created 4 years, 2 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
« no previous file with comments | « no previous file | ash/common/system/chromeos/power/tray_power.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 756ebc2391f063a892e981bad72e44f1224249cb..78485d38d96927446f43360d3affc144820bb61b 100644
--- a/ash/common/system/chromeos/network/tray_network.cc
+++ b/ash/common/system/chromeos/network/tray_network.cc
@@ -48,12 +48,7 @@ class NetworkTrayView : public TrayItemView,
public:
explicit NetworkTrayView(TrayNetwork* network_tray)
: TrayItemView(network_tray) {
- SetLayoutManager(
- new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0));
-
- image_view_ = new views::ImageView;
- AddChildView(image_view_);
-
+ CreateImageView();
UpdateNetworkStateHandlerIcon();
}
@@ -88,14 +83,6 @@ class NetworkTrayView : public TrayItemView,
}
}
- void UpdateAlignment(ShelfAlignment alignment) {
- SetLayoutManager(new views::BoxLayout(IsHorizontalAlignment(alignment)
- ? views::BoxLayout::kHorizontal
- : views::BoxLayout::kVertical,
- 0, 0, 0));
- Layout();
- }
-
// views::View:
void GetAccessibleState(ui::AXViewState* state) override {
state->name = connection_status_string_;
@@ -122,12 +109,11 @@ class NetworkTrayView : public TrayItemView,
}
void UpdateIcon(bool tray_icon_visible, const gfx::ImageSkia& image) {
- image_view_->SetImage(image);
+ image_view()->SetImage(image);
SetVisible(tray_icon_visible);
SchedulePaint();
}
- views::ImageView* image_view_;
base::string16 connection_status_string_;
DISALLOW_COPY_AND_ASSIGN(NetworkTrayView);
@@ -308,10 +294,8 @@ void TrayNetwork::DestroyDetailedView() {
void TrayNetwork::UpdateAfterLoginStatusChange(LoginStatus status) {}
void TrayNetwork::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) {
- if (tray_) {
+ if (tray_)
SetTrayImageItemBorder(tray_, alignment);
- tray_->UpdateAlignment(alignment);
- }
}
void TrayNetwork::RequestToggleWifi() {
« no previous file with comments | « no previous file | ash/common/system/chromeos/power/tray_power.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698