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

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

Issue 2785823002: cros: do not try to activate system tray bubble if it is in process of closing (Closed)
Patch Set: nit Created 3 years, 8 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 | 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/common/system/tray/system_tray.h" 5 #include "ash/common/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 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 base::Bind(&SystemTray::ActivateAndStartNavigation, 691 base::Bind(&SystemTray::ActivateAndStartNavigation,
692 base::Unretained(this))); 692 base::Unretained(this)));
693 key_event_watcher_->AddKeyEventCallback( 693 key_event_watcher_->AddKeyEventCallback(
694 ui::Accelerator(ui::VKEY_TAB, ui::EF_SHIFT_DOWN), 694 ui::Accelerator(ui::VKEY_TAB, ui::EF_SHIFT_DOWN),
695 base::Bind(&SystemTray::ActivateAndStartNavigation, 695 base::Bind(&SystemTray::ActivateAndStartNavigation,
696 base::Unretained(this))); 696 base::Unretained(this)));
697 } 697 }
698 698
699 void SystemTray::ActivateBubble() { 699 void SystemTray::ActivateBubble() {
700 TrayBubbleView* bubble_view = GetSystemBubble()->bubble_view(); 700 TrayBubbleView* bubble_view = GetSystemBubble()->bubble_view();
701 // If system tray bubble is in the process of closing, do not try to activate
702 // bubble.
703 if (bubble_view->GetWidget()->IsClosed())
704 return;
701 bubble_view->set_can_activate(true); 705 bubble_view->set_can_activate(true);
702 bubble_view->GetWidget()->Activate(); 706 bubble_view->GetWidget()->Activate();
703 } 707 }
704 708
705 bool SystemTray::PerformAction(const ui::Event& event) { 709 bool SystemTray::PerformAction(const ui::Event& event) {
706 // If we're already showing the default view, hide it; otherwise, show it 710 // If we're already showing the default view, hide it; otherwise, show it
707 // (and hide any popup that's currently shown). 711 // (and hide any popup that's currently shown).
708 if (HasSystemBubbleType(SystemTrayBubble::BUBBLE_TYPE_DEFAULT)) { 712 if (HasSystemBubbleType(SystemTrayBubble::BUBBLE_TYPE_DEFAULT)) {
709 system_bubble_->bubble()->Close(); 713 system_bubble_->bubble()->Close();
710 } else { 714 } else {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 .work_area() 753 .work_area()
750 .height(); 754 .height();
751 if (work_area_height > 0) { 755 if (work_area_height > 0) {
752 UMA_HISTOGRAM_CUSTOM_COUNTS( 756 UMA_HISTOGRAM_CUSTOM_COUNTS(
753 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", 757 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu",
754 100 * bubble_view->height() / work_area_height, 1, 300, 100); 758 100 * bubble_view->height() / work_area_height, 1, 300, 100);
755 } 759 }
756 } 760 }
757 761
758 } // namespace ash 762 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698