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

Side by Side Diff: ash/common/system/tray_accessibility.cc

Issue 2497813002: Modify Ash MD system menu layout for title rows (Closed)
Patch Set: trybots 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 unified diff | Download patch
« no previous file with comments | « ash/common/system/tray/tray_details_view.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/common/system/tray_accessibility.h" 5 #include "ash/common/system/tray_accessibility.h"
6 6
7 #include "ash/common/accessibility_delegate.h" 7 #include "ash/common/accessibility_delegate.h"
8 #include "ash/common/accessibility_types.h" 8 #include "ash/common/accessibility_types.h"
9 #include "ash/common/material_design/material_design_controller.h" 9 #include "ash/common/material_design/material_design_controller.h"
10 #include "ash/common/session/session_state_delegate.h" 10 #include "ash/common/session/session_state_delegate.h"
11 #include "ash/common/system/tray/hover_highlight_view.h" 11 #include "ash/common/system/tray/hover_highlight_view.h"
12 #include "ash/common/system/tray/system_tray.h" 12 #include "ash/common/system/tray/system_tray.h"
13 #include "ash/common/system/tray/system_tray_controller.h" 13 #include "ash/common/system/tray/system_tray_controller.h"
14 #include "ash/common/system/tray/system_tray_delegate.h" 14 #include "ash/common/system/tray/system_tray_delegate.h"
15 #include "ash/common/system/tray/system_tray_notifier.h" 15 #include "ash/common/system/tray/system_tray_notifier.h"
16 #include "ash/common/system/tray/tray_constants.h" 16 #include "ash/common/system/tray/tray_constants.h"
17 #include "ash/common/system/tray/tray_details_view.h" 17 #include "ash/common/system/tray/tray_details_view.h"
18 #include "ash/common/system/tray/tray_item_more.h" 18 #include "ash/common/system/tray/tray_item_more.h"
19 #include "ash/common/system/tray/tray_popup_item_style.h" 19 #include "ash/common/system/tray/tray_popup_item_style.h"
20 #include "ash/common/system/tray/tray_popup_label_button.h" 20 #include "ash/common/system/tray/tray_popup_label_button.h"
21 #include "ash/common/system/tray/tray_popup_utils.h" 21 #include "ash/common/system/tray/tray_popup_utils.h"
22 #include "ash/common/system/tray/tri_view.h"
22 #include "ash/common/wm_shell.h" 23 #include "ash/common/wm_shell.h"
23 #include "ash/resources/vector_icons/vector_icons.h" 24 #include "ash/resources/vector_icons/vector_icons.h"
24 #include "base/strings/utf_string_conversions.h" 25 #include "base/strings/utf_string_conversions.h"
25 #include "grit/ash_resources.h" 26 #include "grit/ash_resources.h"
26 #include "grit/ash_strings.h" 27 #include "grit/ash_strings.h"
27 #include "ui/base/l10n/l10n_util.h" 28 #include "ui/base/l10n/l10n_util.h"
28 #include "ui/base/resource/resource_bundle.h" 29 #include "ui/base/resource/resource_bundle.h"
29 #include "ui/gfx/color_palette.h" 30 #include "ui/gfx/color_palette.h"
30 #include "ui/gfx/image/image.h" 31 #include "ui/gfx/image/image.h"
31 #include "ui/gfx/paint_vector_icon.h" 32 #include "ui/gfx/paint_vector_icon.h"
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 void AccessibilityDetailedView::HandleButtonPressed(views::Button* sender, 330 void AccessibilityDetailedView::HandleButtonPressed(views::Button* sender,
330 const ui::Event& event) { 331 const ui::Event& event) {
331 if (sender == help_view_) 332 if (sender == help_view_)
332 ShowHelp(); 333 ShowHelp();
333 else if (sender == settings_view_) 334 else if (sender == settings_view_)
334 ShowSettings(); 335 ShowSettings();
335 } 336 }
336 337
337 void AccessibilityDetailedView::CreateExtraTitleRowButtons() { 338 void AccessibilityDetailedView::CreateExtraTitleRowButtons() {
338 if (UseMdMenu()) { 339 if (UseMdMenu()) {
339 help_view_ = title_row()->AddHelpButton(this, login_); 340 DCHECK(!help_view_);
340 settings_view_ = title_row()->AddSettingsButton(this, login_); 341 DCHECK(!settings_view_);
342
343 tri_view()->SetContainerVisible(TriView::Container::END, true);
344
345 help_view_ = CreateHelpButton(login_);
346 settings_view_ = CreateSettingsButton(login_);
347 tri_view()->AddView(TriView::Container::END, help_view_);
348 tri_view()->AddView(TriView::Container::END, settings_view_);
341 } 349 }
342 } 350 }
343 351
344 void AccessibilityDetailedView::ShowSettings() { 352 void AccessibilityDetailedView::ShowSettings() {
345 if (TrayPopupUtils::CanOpenWebUISettings(login_)) { 353 if (TrayPopupUtils::CanOpenWebUISettings(login_)) {
346 WmShell::Get()->system_tray_controller()->ShowAccessibilitySettings(); 354 WmShell::Get()->system_tray_controller()->ShowAccessibilitySettings();
347 owner()->system_tray()->CloseSystemBubble(); 355 owner()->system_tray()->CloseSystemBubble();
348 } 356 }
349 } 357 }
350 358
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 if (detailed_popup_) 485 if (detailed_popup_)
478 detailed_popup_->GetWidget()->Close(); 486 detailed_popup_->GetWidget()->Close();
479 if (detailed_menu_) 487 if (detailed_menu_)
480 detailed_menu_->GetWidget()->Close(); 488 detailed_menu_->GetWidget()->Close();
481 } 489 }
482 490
483 previous_accessibility_state_ = accessibility_state; 491 previous_accessibility_state_ = accessibility_state;
484 } 492 }
485 493
486 } // namespace ash 494 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/tray/tray_details_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698