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

Side by Side Diff: ash/common/system/ime/tray_ime_chromeos.cc

Issue 2497813002: Modify Ash MD system menu layout for title rows (Closed)
Patch Set: self review 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
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/ime/tray_ime_chromeos.h" 5 #include "ash/common/system/ime/tray_ime_chromeos.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
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/chromeos/ime_menu/ime_list_view.h" 11 #include "ash/common/system/chromeos/ime_menu/ime_list_view.h"
12 #include "ash/common/system/tray/hover_highlight_view.h" 12 #include "ash/common/system/tray/hover_highlight_view.h"
13 #include "ash/common/system/tray/system_tray.h" 13 #include "ash/common/system/tray/system_tray.h"
14 #include "ash/common/system/tray/system_tray_controller.h" 14 #include "ash/common/system/tray/system_tray_controller.h"
15 #include "ash/common/system/tray/system_tray_delegate.h" 15 #include "ash/common/system/tray/system_tray_delegate.h"
16 #include "ash/common/system/tray/system_tray_notifier.h" 16 #include "ash/common/system/tray/system_tray_notifier.h"
17 #include "ash/common/system/tray/tray_constants.h" 17 #include "ash/common/system/tray/tray_constants.h"
18 #include "ash/common/system/tray/tray_details_view.h" 18 #include "ash/common/system/tray/tray_details_view.h"
19 #include "ash/common/system/tray/tray_item_more.h" 19 #include "ash/common/system/tray/tray_item_more.h"
20 #include "ash/common/system/tray/tray_item_view.h" 20 #include "ash/common/system/tray/tray_item_view.h"
21 #include "ash/common/system/tray/tray_popup_item_style.h" 21 #include "ash/common/system/tray/tray_popup_item_style.h"
22 #include "ash/common/system/tray/tray_popup_utils.h" 22 #include "ash/common/system/tray/tray_popup_utils.h"
23 #include "ash/common/system/tray/tray_utils.h" 23 #include "ash/common/system/tray/tray_utils.h"
24 #include "ash/common/system/tray/tri_view.h"
24 #include "ash/common/system/tray_accessibility.h" 25 #include "ash/common/system/tray_accessibility.h"
25 #include "ash/common/wm_shell.h" 26 #include "ash/common/wm_shell.h"
26 #include "ash/resources/vector_icons/vector_icons.h" 27 #include "ash/resources/vector_icons/vector_icons.h"
27 #include "base/logging.h" 28 #include "base/logging.h"
28 #include "base/strings/utf_string_conversions.h" 29 #include "base/strings/utf_string_conversions.h"
29 #include "grit/ash_resources.h" 30 #include "grit/ash_resources.h"
30 #include "grit/ash_strings.h" 31 #include "grit/ash_strings.h"
31 #include "ui/accessibility/ax_enums.h" 32 #include "ui/accessibility/ax_enums.h"
32 #include "ui/accessibility/ax_node_data.h" 33 #include "ui/accessibility/ax_node_data.h"
33 #include "ui/base/resource/resource_bundle.h" 34 #include "ui/base/resource/resource_bundle.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 ShowSettings(); 151 ShowSettings();
151 } 152 }
152 153
153 void HandleButtonPressed(views::Button* sender, 154 void HandleButtonPressed(views::Button* sender,
154 const ui::Event& event) override { 155 const ui::Event& event) override {
155 if (sender == settings_button_) 156 if (sender == settings_button_)
156 ShowSettings(); 157 ShowSettings();
157 } 158 }
158 159
159 void CreateExtraTitleRowButtons() override { 160 void CreateExtraTitleRowButtons() override {
160 if (MaterialDesignController::IsSystemTrayMenuMaterial()) 161 if (MaterialDesignController::IsSystemTrayMenuMaterial()) {
161 settings_button_ = title_row()->AddSettingsButton(this, login_); 162 DCHECK(tri_view());
bruthig 2016/11/14 04:39:11 nit: not needed.
tdanderson 2016/11/14 19:24:59 Done.
163 tri_view()->SetContainerVisible(TriView::Container::END, true);
164
165 settings_button_ = CreateSettingsButton(login_);
166 tri_view()->AddView(TriView::Container::END, settings_button_);
167 }
162 } 168 }
163 169
164 void AppendSettings() { 170 void AppendSettings() {
165 HoverHighlightView* container = new HoverHighlightView(this); 171 HoverHighlightView* container = new HoverHighlightView(this);
166 container->AddLabel( 172 container->AddLabel(
167 ui::ResourceBundle::GetSharedInstance().GetLocalizedString( 173 ui::ResourceBundle::GetSharedInstance().GetLocalizedString(
168 IDS_ASH_STATUS_TRAY_IME_SETTINGS), 174 IDS_ASH_STATUS_TRAY_IME_SETTINGS),
169 gfx::ALIGN_LEFT, false /* highlight */); 175 gfx::ALIGN_LEFT, false /* highlight */);
170 AddChildView(container); 176 AddChildView(container);
171 settings_ = container; 177 settings_ = container;
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 else 339 else
334 Update(); 340 Update();
335 } 341 }
336 342
337 bool TrayIME::ShouldDefaultViewBeVisible() { 343 bool TrayIME::ShouldDefaultViewBeVisible() {
338 return is_visible_ && (ime_list_.size() > 1 || property_list_.size() > 1 || 344 return is_visible_ && (ime_list_.size() > 1 || property_list_.size() > 1 ||
339 ShouldShowKeyboardToggle()); 345 ShouldShowKeyboardToggle());
340 } 346 }
341 347
342 } // namespace ash 348 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698