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

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

Issue 11030017: Add context to gfx::Screen calls in support of simultaneous desktop+ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win fix Created 8 years, 2 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 | Annotate | Revision Log
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/tray_bubble_view.h" 5 #include "ash/system/tray/tray_bubble_view.h"
6 6
7 #include "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell_window_ids.h" 9 #include "ash/shell_window_ids.h"
10 #include "ash/system/tray/tray_constants.h" 10 #include "ash/system/tray/tray_constants.h"
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 0, 0, kPaddingFromBottomOfScreenVerticalAlignment); 402 0, 0, kPaddingFromBottomOfScreenVerticalAlignment);
403 } else if (params_.shelf_alignment == SHELF_ALIGNMENT_RIGHT) { 403 } else if (params_.shelf_alignment == SHELF_ALIGNMENT_RIGHT) {
404 rect.Inset(0, 0, kPaddingFromInnerEdgeOfLauncherVerticalAlignment, 404 rect.Inset(0, 0, kPaddingFromInnerEdgeOfLauncherVerticalAlignment,
405 kPaddingFromBottomOfScreenVerticalAlignment); 405 kPaddingFromBottomOfScreenVerticalAlignment);
406 } 406 }
407 } 407 }
408 } 408 }
409 409
410 // TODO(jennyz): May need to add left/right alignment in the following code. 410 // TODO(jennyz): May need to add left/right alignment in the following code.
411 if (rect.IsEmpty()) { 411 if (rect.IsEmpty()) {
412 rect = gfx::Screen::GetPrimaryDisplay().bounds(); 412 rect = ash::Shell::GetAshScreen()->GetPrimaryDisplay().bounds();
413 rect = gfx::Rect( 413 rect = gfx::Rect(
414 base::i18n::IsRTL() ? kPaddingFromRightEdgeOfScreenBottomAlignment : 414 base::i18n::IsRTL() ? kPaddingFromRightEdgeOfScreenBottomAlignment :
415 rect.width() - kPaddingFromRightEdgeOfScreenBottomAlignment, 415 rect.width() - kPaddingFromRightEdgeOfScreenBottomAlignment,
416 rect.height() - kPaddingFromBottomOfScreenBottomAlignment, 416 rect.height() - kPaddingFromBottomOfScreenBottomAlignment,
417 0, 0); 417 0, 0);
418 } 418 }
419 return rect; 419 return rect;
420 } 420 }
421 421
422 gfx::Rect TrayBubbleView::GetBubbleBounds() { 422 gfx::Rect TrayBubbleView::GetBubbleBounds() {
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 return; 563 return;
564 } 564 }
565 // Handle clicking outside the bubble and tray. We don't block the event, so 565 // Handle clicking outside the bubble and tray. We don't block the event, so
566 // it will also be handled by whatever widget was clicked on. 566 // it will also be handled by whatever widget was clicked on.
567 OnClickedOutsideView(); 567 OnClickedOutsideView();
568 } 568 }
569 569
570 570
571 } // namespace internal 571 } // namespace internal
572 } // namespace ash 572 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698