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

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

Issue 2848783002: [Merge to M59]Open system menu when click the status tray with volume popup opened. (Closed)
Patch Set: Created 3 years, 7 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/system_tray.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/system/tray/system_tray.h" 5 #include "ash/system/tray/system_tray.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 } 202 }
203 203
204 private: 204 private:
205 SystemTray* tray_; 205 SystemTray* tray_;
206 206
207 DISALLOW_COPY_AND_ASSIGN(ActivationObserver); 207 DISALLOW_COPY_AND_ASSIGN(ActivationObserver);
208 }; 208 };
209 209
210 // SystemTray 210 // SystemTray
211 211
212 SystemTray::SystemTray(WmShelf* wm_shelf) 212 SystemTray::SystemTray(WmShelf* wm_shelf) : TrayBackgroundView(wm_shelf, true) {
213 : TrayBackgroundView(wm_shelf, true),
214 web_notification_tray_(nullptr),
215 detailed_item_(nullptr),
216 default_bubble_height_(0),
217 full_system_tray_menu_(false),
218 tray_accessibility_(nullptr),
219 tray_audio_(nullptr),
220 tray_cast_(nullptr),
221 tray_network_(nullptr),
222 tray_tiles_(nullptr),
223 tray_system_info_(nullptr),
224 tray_update_(nullptr),
225 screen_capture_tray_item_(nullptr),
226 screen_share_tray_item_(nullptr) {
227 SetInkDropMode(InkDropMode::ON); 213 SetInkDropMode(InkDropMode::ON);
228 214
229 // Since user avatar is on the right hand side of System tray of a 215 // Since user avatar is on the right hand side of System tray of a
230 // horizontal shelf and that is sufficient to indicate separation, no 216 // horizontal shelf and that is sufficient to indicate separation, no
231 // separator is required. 217 // separator is required.
232 set_separator_visibility(false); 218 set_separator_visibility(false);
233 } 219 }
234 220
235 SystemTray::~SystemTray() { 221 SystemTray::~SystemTray() {
236 // Destroy any child views that might have back pointers before ~View(). 222 // Destroy any child views that might have back pointers before ~View().
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 TrayBubbleView* bubble_view = GetSystemBubble()->bubble_view(); 677 TrayBubbleView* bubble_view = GetSystemBubble()->bubble_view();
692 // If system tray bubble is in the process of closing, do not try to activate 678 // If system tray bubble is in the process of closing, do not try to activate
693 // bubble. 679 // bubble.
694 if (bubble_view->GetWidget()->IsClosed()) 680 if (bubble_view->GetWidget()->IsClosed())
695 return; 681 return;
696 bubble_view->set_can_activate(true); 682 bubble_view->set_can_activate(true);
697 bubble_view->GetWidget()->Activate(); 683 bubble_view->GetWidget()->Activate();
698 } 684 }
699 685
700 bool SystemTray::PerformAction(const ui::Event& event) { 686 bool SystemTray::PerformAction(const ui::Event& event) {
701 // If we're already showing the menu, hide it; otherwise, show it (and hide 687 // If we're already showing the default view or detailed view in system menu,
702 // any popup that's currently shown). 688 // hide it; otherwise, show it (and hide any popup that's currently shown).
703 if (HasSystemBubble()) { 689 if (HasSystemBubbleType(SystemTrayBubble::BUBBLE_TYPE_DEFAULT) ||
690 (HasSystemBubbleType(SystemTrayBubble::BUBBLE_TYPE_DETAILED) &&
691 full_system_tray_menu_)) {
704 system_bubble_->bubble()->Close(); 692 system_bubble_->bubble()->Close();
705 } else { 693 } else {
706 ShowDefaultView(BUBBLE_CREATE_NEW); 694 ShowDefaultView(BUBBLE_CREATE_NEW);
707 if (event.IsKeyEvent() || (event.flags() & ui::EF_TOUCH_ACCESSIBILITY)) 695 if (event.IsKeyEvent() || (event.flags() & ui::EF_TOUCH_ACCESSIBILITY))
708 ActivateBubble(); 696 ActivateBubble();
709 } 697 }
710 return true; 698 return true;
711 } 699 }
712 700
713 void SystemTray::CloseSystemBubbleAndDeactivateSystemTray() { 701 void SystemTray::CloseSystemBubbleAndDeactivateSystemTray() {
(...skipping 29 matching lines...) Expand all
743 .work_area() 731 .work_area()
744 .height(); 732 .height();
745 if (work_area_height > 0) { 733 if (work_area_height > 0) {
746 UMA_HISTOGRAM_CUSTOM_COUNTS( 734 UMA_HISTOGRAM_CUSTOM_COUNTS(
747 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", 735 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu",
748 100 * bubble_view->height() / work_area_height, 1, 300, 100); 736 100 * bubble_view->height() / work_area_height, 1, 300, 100);
749 } 737 }
750 } 738 }
751 739
752 } // namespace ash 740 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray/system_tray.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698