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

Side by Side Diff: ash/system/audio/volume_view.cc

Issue 2932053003: [ash] Made TriView's re-layout automatically when a child container's visibility changes. (Closed)
Patch Set: Fixed compile error. Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | ash/system/tray/tri_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/system/audio/volume_view.h" 5 #include "ash/system/audio/volume_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/metrics/user_metrics_action.h" 9 #include "ash/metrics/user_metrics_action.h"
10 #include "ash/resources/vector_icons/vector_icons.h" 10 #include "ash/resources/vector_icons/vector_icons.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 } 167 }
168 168
169 void VolumeView::UpdateDeviceTypeAndMore() { 169 void VolumeView::UpdateDeviceTypeAndMore() {
170 CrasAudioHandler* audio_handler = CrasAudioHandler::Get(); 170 CrasAudioHandler* audio_handler = CrasAudioHandler::Get();
171 // There is no point in letting the user open the audio detailed submenu if 171 // There is no point in letting the user open the audio detailed submenu if
172 // there are no alternative output or input devices present, so do not show 172 // there are no alternative output or input devices present, so do not show
173 // the 'more' button in the default audio row. 173 // the 'more' button in the default audio row.
174 if (is_default_view_ && !audio_handler->has_alternative_output() && 174 if (is_default_view_ && !audio_handler->has_alternative_output() &&
175 !audio_handler->has_alternative_input()) { 175 !audio_handler->has_alternative_input()) {
176 tri_view_->SetContainerVisible(TriView::Container::END, false); 176 tri_view_->SetContainerVisible(TriView::Container::END, false);
177 // TODO(tdanderson): TriView itself should trigger a relayout when the
178 // visibility of one of its containers is changed.
179 tri_view_->InvalidateLayout();
180 return; 177 return;
181 } 178 }
182 179
183 const gfx::VectorIcon& device_icon = GetActiveOutputDeviceVectorIcon(); 180 const gfx::VectorIcon& device_icon = GetActiveOutputDeviceVectorIcon();
184 const bool device_icon_visibility = !device_icon.is_empty(); 181 const bool device_icon_visibility = !device_icon.is_empty();
185 182
186 if (is_default_view_) { 183 if (is_default_view_) {
187 if (!more_button_) { 184 if (!more_button_) {
188 more_button_ = new ButtonListenerActionableView( 185 more_button_ = new ButtonListenerActionableView(
189 owner_, TrayPopupInkDropStyle::INSET_BOUNDS, this); 186 owner_, TrayPopupInkDropStyle::INSET_BOUNDS, this);
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 if (new_volume > current_volume) 273 if (new_volume > current_volume)
277 HandleVolumeUp(new_volume); 274 HandleVolumeUp(new_volume);
278 else 275 else
279 HandleVolumeDown(new_volume); 276 HandleVolumeDown(new_volume);
280 } 277 }
281 icon_->Update(); 278 icon_->Update();
282 } 279 }
283 280
284 } // namespace tray 281 } // namespace tray
285 } // namespace ash 282 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/system/tray/tri_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698