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/notifications/balloon_collection_impl.h" | 5 #include "chrome/browser/notifications/balloon_collection_impl.h" |
6 | 6 |
7 #include "chrome/browser/notifications/balloon.h" | 7 #include "chrome/browser/notifications/balloon.h" |
8 #include "chrome/browser/ui/views/notifications/balloon_view_views.h" | 8 #include "chrome/browser/ui/views/notifications/balloon_view_views.h" |
9 #include "ui/base/events/event_constants.h" | 9 #include "ui/base/events/event_constants.h" |
10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 NOTIMPLEMENTED(); | 73 NOTIMPLEMENTED(); |
74 #endif | 74 #endif |
75 } | 75 } |
76 | 76 |
77 bool BalloonCollectionImpl::IsCursorInBalloonCollection() const { | 77 bool BalloonCollectionImpl::IsCursorInBalloonCollection() const { |
78 #if defined(OS_WIN) | 78 #if defined(OS_WIN) |
79 gfx::Point cursor(GetMessagePos()); | 79 gfx::Point cursor(GetMessagePos()); |
80 #else | 80 #else |
81 // TODO(saintlou): Not sure if this is correct because on Windows at least | 81 // TODO(saintlou): Not sure if this is correct because on Windows at least |
82 // the following call is GetCursorPos() not GetMessagePos(). | 82 // the following call is GetCursorPos() not GetMessagePos(). |
83 gfx::Point cursor(gfx::Screen::GetCursorScreenPoint()); | 83 // TODO(scottmg): NativeScreen might be wrong. http://crbug.com/133312 |
| 84 gfx::Point cursor(gfx::Screen::GetNativeScreen()->GetCursorScreenPoint()); |
84 #endif | 85 #endif |
85 return GetBalloonsBoundingBox().Contains(cursor); | 86 return GetBalloonsBoundingBox().Contains(cursor); |
86 } | 87 } |
87 | 88 |
88 void BalloonCollectionImpl::SetPositionPreference( | 89 void BalloonCollectionImpl::SetPositionPreference( |
89 PositionPreference position) { | 90 PositionPreference position) { |
90 if (position == DEFAULT_POSITION) | 91 if (position == DEFAULT_POSITION) |
91 position = LOWER_RIGHT; | 92 position = LOWER_RIGHT; |
92 | 93 |
93 // All positioning schemes are vertical, and windows | 94 // All positioning schemes are vertical, and windows |
(...skipping 12 matching lines...) Expand all Loading... |
106 layout_.ComputeOffsetToMoveAbovePanels(); | 107 layout_.ComputeOffsetToMoveAbovePanels(); |
107 PositionBalloons(true); | 108 PositionBalloons(true); |
108 } | 109 } |
109 | 110 |
110 #if !defined(OS_CHROMEOS) | 111 #if !defined(OS_CHROMEOS) |
111 // static | 112 // static |
112 BalloonCollection* BalloonCollection::Create() { | 113 BalloonCollection* BalloonCollection::Create() { |
113 return new BalloonCollectionImpl(); | 114 return new BalloonCollectionImpl(); |
114 } | 115 } |
115 #endif | 116 #endif |
OLD | NEW |