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

Side by Side Diff: ash/system/tray/hover_highlight_view.cc

Issue 980943005: Add ash UI for third-party VPNs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@f_2_407541_434711_remove_combined_name
Patch Set: Updated after latest round of UI reviews. Created 5 years, 9 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 | « ash/system/tray/hover_highlight_view.h ('k') | tools/metrics/actions/actions.xml » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/system/tray/hover_highlight_view.h" 5 #include "ash/system/tray/hover_highlight_view.h"
6 6
7 #include "ash/system/tray/fixed_sized_image_view.h" 7 #include "ash/system/tray/fixed_sized_image_view.h"
8 #include "ash/system/tray/tray_constants.h" 8 #include "ash/system/tray/tray_constants.h"
9 #include "ash/system/tray/view_click_listener.h" 9 #include "ash/system/tray/view_click_listener.h"
10 #include "ui/accessibility/ax_view_state.h" 10 #include "ui/accessibility/ax_view_state.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 if (event->type() == ui::ET_GESTURE_TAP_DOWN) { 190 if (event->type() == ui::ET_GESTURE_TAP_DOWN) {
191 SetHoverHighlight(true); 191 SetHoverHighlight(true);
192 } else if (event->type() == ui::ET_GESTURE_TAP_CANCEL || 192 } else if (event->type() == ui::ET_GESTURE_TAP_CANCEL ||
193 event->type() == ui::ET_GESTURE_TAP) { 193 event->type() == ui::ET_GESTURE_TAP) {
194 SetHoverHighlight(false); 194 SetHoverHighlight(false);
195 } 195 }
196 } 196 }
197 ActionableView::OnGestureEvent(event); 197 ActionableView::OnGestureEvent(event);
198 } 198 }
199 199
200 void HoverHighlightView::OnBoundsChanged(const gfx::Rect& previous_bounds) {
201 SetHoverHighlight(IsMouseHovered());
202 }
203
200 void HoverHighlightView::OnEnabledChanged() { 204 void HoverHighlightView::OnEnabledChanged() {
201 for (int i = 0; i < child_count(); ++i) 205 for (int i = 0; i < child_count(); ++i)
202 child_at(i)->SetEnabled(enabled()); 206 child_at(i)->SetEnabled(enabled());
203 } 207 }
204 208
205 void HoverHighlightView::OnPaintBackground(gfx::Canvas* canvas) { 209 void HoverHighlightView::OnPaintBackground(gfx::Canvas* canvas) {
206 canvas->DrawColor(hover_ ? highlight_color_ : default_color_); 210 canvas->DrawColor(hover_ ? highlight_color_ : default_color_);
207 } 211 }
208 212
209 void HoverHighlightView::OnFocus() { 213 void HoverHighlightView::OnFocus() {
210 ScrollRectToVisible(gfx::Rect(gfx::Point(), size())); 214 ScrollRectToVisible(gfx::Rect(gfx::Point(), size()));
211 ActionableView::OnFocus(); 215 ActionableView::OnFocus();
212 } 216 }
213 217
214 } // namespace ash 218 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray/hover_highlight_view.h ('k') | tools/metrics/actions/actions.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698