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

Side by Side Diff: ash/common/system/tray/system_tray.cc

Issue 2190773002: Fix Volume slider is captured in screenshot done in touchview mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: disable hiding animation; restoring volume does not notify UI Created 4 years, 4 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
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/system_tray.h" 5 #include "ash/common/system/tray/system_tray.h"
6 6
7 #include "ash/common/ash_switches.h" 7 #include "ash/common/ash_switches.h"
8 #include "ash/common/login_status.h" 8 #include "ash/common/login_status.h"
9 #include "ash/common/session/session_state_delegate.h" 9 #include "ash/common/session/session_state_delegate.h"
10 #include "ash/common/shelf/wm_shelf.h" 10 #include "ash/common/shelf/wm_shelf.h"
(...skipping 24 matching lines...) Expand all
35 #include "ui/display/display.h" 35 #include "ui/display/display.h"
36 #include "ui/display/screen.h" 36 #include "ui/display/screen.h"
37 #include "ui/events/event_constants.h" 37 #include "ui/events/event_constants.h"
38 #include "ui/gfx/canvas.h" 38 #include "ui/gfx/canvas.h"
39 #include "ui/gfx/skia_util.h" 39 #include "ui/gfx/skia_util.h"
40 #include "ui/views/border.h" 40 #include "ui/views/border.h"
41 #include "ui/views/controls/label.h" 41 #include "ui/views/controls/label.h"
42 #include "ui/views/layout/box_layout.h" 42 #include "ui/views/layout/box_layout.h"
43 #include "ui/views/layout/fill_layout.h" 43 #include "ui/views/layout/fill_layout.h"
44 #include "ui/views/view.h" 44 #include "ui/views/view.h"
45 #include "ui/views/widget/widget.h"
45 46
46 #if defined(OS_CHROMEOS) 47 #if defined(OS_CHROMEOS)
47 #include "ash/common/system/chromeos/audio/tray_audio_chromeos.h" 48 #include "ash/common/system/chromeos/audio/tray_audio_chromeos.h"
48 #include "ash/common/system/chromeos/bluetooth/tray_bluetooth.h" 49 #include "ash/common/system/chromeos/bluetooth/tray_bluetooth.h"
49 #include "ash/common/system/chromeos/brightness/tray_brightness.h" 50 #include "ash/common/system/chromeos/brightness/tray_brightness.h"
50 #include "ash/common/system/chromeos/enterprise/tray_enterprise.h" 51 #include "ash/common/system/chromeos/enterprise/tray_enterprise.h"
51 #include "ash/common/system/chromeos/media_security/multi_profile_media_tray_ite m.h" 52 #include "ash/common/system/chromeos/media_security/multi_profile_media_tray_ite m.h"
52 #include "ash/common/system/chromeos/network/tray_network.h" 53 #include "ash/common/system/chromeos/network/tray_network.h"
53 #include "ash/common/system/chromeos/network/tray_sms.h" 54 #include "ash/common/system/chromeos/network/tray_sms.h"
54 #include "ash/common/system/chromeos/network/tray_vpn.h" 55 #include "ash/common/system/chromeos/network/tray_vpn.h"
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 persistent); 271 persistent);
271 if (system_bubble_) 272 if (system_bubble_)
272 system_bubble_->bubble()->StartAutoCloseTimer(close_delay); 273 system_bubble_->bubble()->StartAutoCloseTimer(close_delay);
273 } 274 }
274 275
275 void SystemTray::SetDetailedViewCloseDelay(int close_delay) { 276 void SystemTray::SetDetailedViewCloseDelay(int close_delay) {
276 if (HasSystemBubbleType(SystemTrayBubble::BUBBLE_TYPE_DETAILED)) 277 if (HasSystemBubbleType(SystemTrayBubble::BUBBLE_TYPE_DETAILED))
277 system_bubble_->bubble()->StartAutoCloseTimer(close_delay); 278 system_bubble_->bubble()->StartAutoCloseTimer(close_delay);
278 } 279 }
279 280
280 void SystemTray::HideDetailedView(SystemTrayItem* item) { 281 void SystemTray::HideDetailedView(SystemTrayItem* item, bool hide_animation) {
282 if (!hide_animation) {
283 // In unittest, GetSystemBubble might return nullptr.
284 if (GetSystemBubble()) {
285 GetSystemBubble()
286 ->bubble_view()
287 ->GetWidget()
288 ->SetVisibilityAnimationTransition(
Daniel Erat 2016/07/28 22:20:40 does this affect future transitions, or does a new
Qiang(Joe) Xu 2016/07/28 23:15:57 Yes, systembubble is autoclosed everytime. So this
289 views::Widget::VisibilityTransition::ANIMATE_NONE);
290 }
291 }
281 if (item != detailed_item_) 292 if (item != detailed_item_)
282 return; 293 return;
283 DestroySystemBubble(); 294 DestroySystemBubble();
284 UpdateNotificationBubble(); 295 UpdateNotificationBubble();
285 } 296 }
286 297
287 void SystemTray::ShowNotificationView(SystemTrayItem* item) { 298 void SystemTray::ShowNotificationView(SystemTrayItem* item) {
288 if (std::find(notification_items_.begin(), notification_items_.end(), item) != 299 if (std::find(notification_items_.begin(), notification_items_.end(), item) !=
289 notification_items_.end()) 300 notification_items_.end())
290 return; 301 return;
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 .work_area() 780 .work_area()
770 .height(); 781 .height();
771 if (work_area_height > 0) { 782 if (work_area_height > 0) {
772 UMA_HISTOGRAM_CUSTOM_COUNTS( 783 UMA_HISTOGRAM_CUSTOM_COUNTS(
773 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", 784 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu",
774 100 * bubble_view->height() / work_area_height, 1, 300, 100); 785 100 * bubble_view->height() / work_area_height, 1, 300, 100);
775 } 786 }
776 } 787 }
777 788
778 } // namespace ash 789 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698