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

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

Issue 2680643002: Add old_state parameter to CustomButton::StateChanged (Closed)
Patch Set: Created 3 years, 10 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/common/system/chromeos/network/network_state_list_detailed_view.cc » ('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/common/system/chromeos/audio/volume_view.h" 5 #include "ash/common/system/chromeos/audio/volume_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
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/metrics/user_metrics_action.h" 10 #include "ash/common/metrics/user_metrics_action.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 void GetAccessibleNodeData(ui::AXNodeData* node_data) override { 119 void GetAccessibleNodeData(ui::AXNodeData* node_data) override {
120 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); 120 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
121 node_data->SetName( 121 node_data->SetName(
122 bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_VOLUME_MUTE)); 122 bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_VOLUME_MUTE));
123 node_data->role = ui::AX_ROLE_TOGGLE_BUTTON; 123 node_data->role = ui::AX_ROLE_TOGGLE_BUTTON;
124 if (audio_delegate_->IsOutputAudioMuted()) 124 if (audio_delegate_->IsOutputAudioMuted())
125 node_data->AddStateFlag(ui::AX_STATE_PRESSED); 125 node_data->AddStateFlag(ui::AX_STATE_PRESSED);
126 } 126 }
127 127
128 // views::CustomButton: 128 // views::CustomButton:
129 void StateChanged() override { 129 void StateChanged(ButtonState old_state) override {
130 if (state() == STATE_HOVERED || state() == STATE_PRESSED) { 130 if (state() == STATE_HOVERED || state() == STATE_PRESSED) {
131 if (!MaterialDesignController::IsSystemTrayMenuMaterial()) { 131 if (!MaterialDesignController::IsSystemTrayMenuMaterial()) {
132 set_background( 132 set_background(
133 views::Background::CreateSolidBackground(kHoverBackgroundColor)); 133 views::Background::CreateSolidBackground(kHoverBackgroundColor));
134 } 134 }
135 } else { 135 } else {
136 set_background(nullptr); 136 set_background(nullptr);
137 } 137 }
138 } 138 }
139 139
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 void VolumeView::OnBoundsChanged(const gfx::Rect& previous_bounds) { 343 void VolumeView::OnBoundsChanged(const gfx::Rect& previous_bounds) {
344 // Separator's prefered size is based on set bounds. When an empty bounds is 344 // Separator's prefered size is based on set bounds. When an empty bounds is
345 // set on first layout this causes BoxLayout to ignore the separator. Reset 345 // set on first layout this causes BoxLayout to ignore the separator. Reset
346 // its height on each bounds change so that it is laid out properly. 346 // its height on each bounds change so that it is laid out properly.
347 if (separator_) 347 if (separator_)
348 separator_->SetSize(gfx::Size(kSeparatorSize, bounds().height())); 348 separator_->SetSize(gfx::Size(kSeparatorSize, bounds().height()));
349 } 349 }
350 350
351 } // namespace tray 351 } // namespace tray
352 } // namespace ash 352 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/common/system/chromeos/network/network_state_list_detailed_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698