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

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

Issue 2804523002: Fix mistmached |GetDisplayNearest{Window,View}| param type (Closed)
Patch Set: window 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 | ash/common/wm/window_cycle_list.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 (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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 SetIsActive(true); 541 SetIsActive(true);
542 } 542 }
543 543
544 void SystemTray::UpdateWebNotifications() { 544 void SystemTray::UpdateWebNotifications() {
545 TrayBubbleView* bubble_view = NULL; 545 TrayBubbleView* bubble_view = NULL;
546 if (system_bubble_) 546 if (system_bubble_)
547 bubble_view = system_bubble_->bubble_view(); 547 bubble_view = system_bubble_->bubble_view();
548 548
549 int height = 0; 549 int height = 0;
550 if (bubble_view) { 550 if (bubble_view) {
551 gfx::Rect work_area = 551 gfx::Rect work_area = display::Screen::GetScreen()
552 display::Screen::GetScreen() 552 ->GetDisplayNearestWindow(
553 ->GetDisplayNearestWindow(bubble_view->GetWidget()->GetNativeView()) 553 bubble_view->GetWidget()->GetNativeWindow())
554 .work_area(); 554 .work_area();
555 height = 555 height =
556 std::max(0, work_area.bottom() - bubble_view->GetBoundsInScreen().y()); 556 std::max(0, work_area.bottom() - bubble_view->GetBoundsInScreen().y());
557 } 557 }
558 if (web_notification_tray_) 558 if (web_notification_tray_)
559 web_notification_tray_->SetTrayBubbleHeight(height); 559 web_notification_tray_->SetTrayBubbleHeight(height);
560 } 560 }
561 561
562 base::string16 SystemTray::GetAccessibleTimeString( 562 base::string16 SystemTray::GetAccessibleTimeString(
563 const base::Time& now) const { 563 const base::Time& now) const {
564 base::HourClockType hour_type = 564 base::HourClockType hour_type =
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 for (int i = 0; i < bubble_view->child_count(); i++) { 742 for (int i = 0; i < bubble_view->child_count(); i++) {
743 // Certain menu rows are attached by default but can set themselves as 743 // Certain menu rows are attached by default but can set themselves as
744 // invisible (IME is one such example). Count only user-visible rows. 744 // invisible (IME is one such example). Count only user-visible rows.
745 if (bubble_view->child_at(i)->visible()) 745 if (bubble_view->child_at(i)->visible())
746 num_rows++; 746 num_rows++;
747 } 747 }
748 UMA_HISTOGRAM_COUNTS_100("Ash.SystemMenu.Rows", num_rows); 748 UMA_HISTOGRAM_COUNTS_100("Ash.SystemMenu.Rows", num_rows);
749 749
750 int work_area_height = 750 int work_area_height =
751 display::Screen::GetScreen() 751 display::Screen::GetScreen()
752 ->GetDisplayNearestWindow(bubble_view->GetWidget()->GetNativeView()) 752 ->GetDisplayNearestWindow(bubble_view->GetWidget()->GetNativeWindow())
753 .work_area() 753 .work_area()
754 .height(); 754 .height();
755 if (work_area_height > 0) { 755 if (work_area_height > 0) {
756 UMA_HISTOGRAM_CUSTOM_COUNTS( 756 UMA_HISTOGRAM_CUSTOM_COUNTS(
757 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", 757 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu",
758 100 * bubble_view->height() / work_area_height, 1, 300, 100); 758 100 * bubble_view->height() / work_area_height, 1, 300, 100);
759 } 759 }
760 } 760 }
761 761
762 } // namespace ash 762 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/common/wm/window_cycle_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698