OLD | NEW |
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/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "ash/system/tray/tray_constants.h" | 9 #include "ash/system/tray/tray_constants.h" |
10 #include "ash/wm/shelf_layout_manager.h" | 10 #include "ash/wm/shelf_layout_manager.h" |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 SetLayoutManager(layout); | 262 SetLayoutManager(layout); |
263 set_background(NULL); | 263 set_background(NULL); |
264 } | 264 } |
265 | 265 |
266 gfx::Rect TrayBubbleView::GetAnchorRect() { | 266 gfx::Rect TrayBubbleView::GetAnchorRect() { |
267 gfx::Rect rect; | 267 gfx::Rect rect; |
268 if (host_) | 268 if (host_) |
269 rect = host_->GetAnchorRect(); | 269 rect = host_->GetAnchorRect(); |
270 // TODO(jennyz): May need to add left/right alignment in the following code. | 270 // TODO(jennyz): May need to add left/right alignment in the following code. |
271 if (rect.IsEmpty()) { | 271 if (rect.IsEmpty()) { |
272 rect = gfx::Screen::GetPrimaryMonitor().bounds(); | 272 rect = gfx::Screen::GetPrimaryDisplay().bounds(); |
273 rect = gfx::Rect( | 273 rect = gfx::Rect( |
274 base::i18n::IsRTL() ? kPaddingFromRightEdgeOfScreenBottomAlignment : | 274 base::i18n::IsRTL() ? kPaddingFromRightEdgeOfScreenBottomAlignment : |
275 rect.width() - kPaddingFromRightEdgeOfScreenBottomAlignment, | 275 rect.width() - kPaddingFromRightEdgeOfScreenBottomAlignment, |
276 rect.height() - kPaddingFromBottomOfScreenBottomAlignment, | 276 rect.height() - kPaddingFromBottomOfScreenBottomAlignment, |
277 0, 0); | 277 0, 0); |
278 } | 278 } |
279 return rect; | 279 return rect; |
280 } | 280 } |
281 | 281 |
282 gfx::Rect TrayBubbleView::GetBubbleBounds() { | 282 gfx::Rect TrayBubbleView::GetBubbleBounds() { |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 return; | 386 return; |
387 } | 387 } |
388 // Handle clicking outside the bubble and tray. We don't block the event, so | 388 // Handle clicking outside the bubble and tray. We don't block the event, so |
389 // it will also be handled by whatever widget was clicked on. | 389 // it will also be handled by whatever widget was clicked on. |
390 OnClickedOutsideView(); | 390 OnClickedOutsideView(); |
391 } | 391 } |
392 | 392 |
393 | 393 |
394 } // namespace internal | 394 } // namespace internal |
395 } // namespace ash | 395 } // namespace ash |
OLD | NEW |