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

Unified Diff: ash/common/system/tray/special_popup_row.cc

Issue 2429923002: Implement all system menu title row buttons for Ash MD (Closed)
Patch Set: OS_WIN define in tests 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 | « ash/common/system/tray/special_popup_row.h ('k') | ash/common/system/tray/system_menu_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray/special_popup_row.cc
diff --git a/ash/common/system/tray/special_popup_row.cc b/ash/common/system/tray/special_popup_row.cc
index 7ddc711331ae86eb4b1d2f13ed3ad9d886f497b6..b3dff8cbad9ef9cff41c14db0685e96b9de35fd0 100644
--- a/ash/common/system/tray/special_popup_row.cc
+++ b/ash/common/system/tray/special_popup_row.cc
@@ -12,6 +12,7 @@
#include "ash/common/system/tray/tray_constants.h"
#include "ash/common/system/tray/tray_popup_header_button.h"
#include "ash/common/system/tray/tray_popup_item_style.h"
+#include "ash/common/system/tray/tray_utils.h"
#include "ash/resources/vector_icons/vector_icons.h"
#include "grit/ash_resources.h"
#include "grit/ash_strings.h"
@@ -97,29 +98,30 @@ void SpecialPopupRow::SetContent(views::View* view) {
}
views::Button* SpecialPopupRow::AddBackButton(views::ButtonListener* listener) {
- return AddSystemMenuButton(listener, kSystemMenuArrowBackIcon,
- IDS_ASH_STATUS_TRAY_PREVIOUS_MENU, false);
+ SystemMenuButton* button = new SystemMenuButton(
+ listener, kSystemMenuArrowBackIcon, IDS_ASH_STATUS_TRAY_PREVIOUS_MENU);
+ AddViewBeforeContent(button);
+ return button;
}
views::Button* SpecialPopupRow::AddSettingsButton(
- views::ButtonListener* listener) {
- return AddSystemMenuButton(listener, kSystemMenuSettingsIcon,
- IDS_ASH_STATUS_TRAY_SETTINGS, true);
-}
-
-SystemMenuButton* SpecialPopupRow::AddSystemMenuButton(
views::ButtonListener* listener,
- const gfx::VectorIcon& icon,
- int accessible_name_id,
- bool after_content) {
- SystemMenuButton* button =
- new SystemMenuButton(listener, icon, accessible_name_id);
-
- if (after_content)
- AddViewAfterContent(button);
- else
- AddViewBeforeContent(button);
+ LoginStatus status) {
+ SystemMenuButton* button = new SystemMenuButton(
+ listener, kSystemMenuSettingsIcon, IDS_ASH_STATUS_TRAY_SETTINGS);
+ if (!CanOpenWebUISettings(status))
+ button->SetState(views::Button::STATE_DISABLED);
+ AddViewAfterContent(button);
+ return button;
+}
+views::Button* SpecialPopupRow::AddHelpButton(views::ButtonListener* listener,
+ LoginStatus status) {
+ SystemMenuButton* button = new SystemMenuButton(listener, kSystemMenuHelpIcon,
+ IDS_ASH_STATUS_TRAY_HELP);
+ if (!CanOpenWebUISettings(status))
+ button->SetState(views::Button::STATE_DISABLED);
+ AddViewAfterContent(button);
return button;
}
@@ -143,6 +145,10 @@ views::ToggleButton* SpecialPopupRow::AddToggleButton(
return toggle;
}
+void SpecialPopupRow::AddViewToTitleRow(views::View* view) {
+ AddViewAfterContent(view);
+}
+
void SpecialPopupRow::AddViewToRowNonMd(views::View* view, bool add_separator) {
AddViewAfterContent(view, add_separator);
}
« no previous file with comments | « ash/common/system/tray/special_popup_row.h ('k') | ash/common/system/tray/system_menu_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698