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 "chrome/browser/chromeos/ui/setting_level_bubble.h" | 5 #include "chrome/browser/chromeos/ui/setting_level_bubble.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "chrome/browser/chromeos/login/base_login_display_host.h" | 10 #include "chrome/browser/chromeos/login/base_login_display_host.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 SettingLevelBubbleView* view_; | 75 SettingLevelBubbleView* view_; |
76 | 76 |
77 DISALLOW_COPY_AND_ASSIGN(SettingLevelBubbleDelegateView); | 77 DISALLOW_COPY_AND_ASSIGN(SettingLevelBubbleDelegateView); |
78 }; | 78 }; |
79 | 79 |
80 gfx::Rect SettingLevelBubbleDelegateView::GetAnchorRect() { | 80 gfx::Rect SettingLevelBubbleDelegateView::GetAnchorRect() { |
81 gfx::Size view_size = GetPreferredSize(); | 81 gfx::Size view_size = GetPreferredSize(); |
82 // Calculate the position in screen coordinates that the bubble should | 82 // Calculate the position in screen coordinates that the bubble should |
83 // "point" at (since we use BubbleBorder::FLOAT, this position actually | 83 // "point" at (since we use BubbleBorder::FLOAT, this position actually |
84 // specifies the center of the bubble). | 84 // specifies the center of the bubble). |
85 gfx::Rect monitor_area = gfx::Screen::GetMonitorAreaNearestWindow(NULL); | 85 gfx::Rect monitor_area = gfx::Screen::GetPrimaryMonitor().bounds(); |
86 return (gfx::Rect( | 86 return (gfx::Rect( |
87 monitor_area.x() + kBubbleXRatio * monitor_area.width(), | 87 monitor_area.x() + kBubbleXRatio * monitor_area.width(), |
88 monitor_area.bottom() - view_size.height() / 2 - kBubbleBottomGap, 0, 0)); | 88 monitor_area.bottom() - view_size.height() / 2 - kBubbleBottomGap, 0, 0)); |
89 } | 89 } |
90 | 90 |
91 SettingLevelBubbleDelegateView::SettingLevelBubbleDelegateView() | 91 SettingLevelBubbleDelegateView::SettingLevelBubbleDelegateView() |
92 : BubbleDelegateView(NULL, views::BubbleBorder::FLOAT), | 92 : BubbleDelegateView(NULL, views::BubbleBorder::FLOAT), |
93 view_(NULL) { | 93 view_(NULL) { |
94 set_close_on_esc(false); | 94 set_close_on_esc(false); |
95 set_use_focusless(true); | 95 set_use_focusless(true); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 | 259 |
260 last_target_update_time_ = now; | 260 last_target_update_time_ = now; |
261 } | 261 } |
262 | 262 |
263 void SettingLevelBubble::StopAnimation() { | 263 void SettingLevelBubble::StopAnimation() { |
264 animation_timer_.Stop(); | 264 animation_timer_.Stop(); |
265 is_animating_ = false; | 265 is_animating_ = false; |
266 } | 266 } |
267 | 267 |
268 } // namespace chromeos | 268 } // namespace chromeos |
OLD | NEW |