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

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

Issue 2497813002: Modify Ash MD system menu layout for title rows (Closed)
Patch Set: Ben comments 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_state_list_detailed_view.cc
diff --git a/ash/common/system/chromeos/network/network_state_list_detailed_view.cc b/ash/common/system/chromeos/network/network_state_list_detailed_view.cc
index bf85b2f589388dfd8c3b59121775c1cc5f003e13..2bf1528c218cef2ff43b5fcf7579d7219610dc17 100644
--- a/ash/common/system/chromeos/network/network_state_list_detailed_view.cc
+++ b/ash/common/system/chromeos/network/network_state_list_detailed_view.cc
@@ -30,6 +30,7 @@
#include "ash/common/system/tray/tray_details_view.h"
#include "ash/common/system/tray/tray_popup_header_button.h"
#include "ash/common/system/tray/tray_popup_label_button.h"
+#include "ash/common/system/tray/tri_view.h"
#include "ash/common/wm_lookup.h"
#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
@@ -478,12 +479,16 @@ void NetworkStateListDetailedView::CreateExtraTitleRowButtons() {
if (login_ == LoginStatus::LOCKED)
return;
+ DCHECK(!info_button_md_);
+ tri_view()->SetContainerVisible(TriView::Container::END, true);
+
info_button_md_ = new SystemMenuButton(
this, SystemMenuButton::InkDropStyle::SQUARE, kSystemMenuInfoIcon,
IDS_ASH_STATUS_TRAY_NETWORK_INFO);
- title_row()->AddViewToTitleRow(info_button_md_);
+ tri_view()->AddView(TriView::Container::END, info_button_md_);
if (login_ != LoginStatus::NOT_LOGGED_IN) {
+ DCHECK(!settings_button_md_);
settings_button_md_ = new SystemMenuButton(
this, SystemMenuButton::InkDropStyle::SQUARE, kSystemMenuSettingsIcon,
IDS_ASH_STATUS_TRAY_NETWORK_SETTINGS);
@@ -495,7 +500,7 @@ void NetworkStateListDetailedView::CreateExtraTitleRowButtons() {
if (!WmShell::Get()->system_tray_delegate()->ShouldShowSettings())
settings_button_md_->SetState(views::Button::STATE_DISABLED);
- title_row()->AddViewToTitleRow(settings_button_md_);
+ tri_view()->AddView(TriView::Container::END, settings_button_md_);
} else {
proxy_settings_button_md_ = new SystemMenuButton(
this, SystemMenuButton::InkDropStyle::SQUARE, kSystemMenuSettingsIcon,
@@ -661,7 +666,8 @@ void NetworkStateListDetailedView::UpdateHeaderButtons() {
}
}
- static_cast<views::View*>(title_row())->Layout();
+ if (!UseMd())
+ static_cast<views::View*>(title_row())->Layout();
}
void NetworkStateListDetailedView::SetScanningStateForThrobberView(

Powered by Google App Engine
This is Rietveld 408576698