| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/gfx/size.h" | 8 #include "ui/gfx/size.h" |
| 9 | 9 |
| 10 #if defined(TOOLKIT_VIEWS) | 10 #if defined(TOOLKIT_VIEWS) |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 } | 32 } |
| 33 | 33 |
| 34 int BalloonCollectionImpl::Layout::VerticalEdgeMargin() const { | 34 int BalloonCollectionImpl::Layout::VerticalEdgeMargin() const { |
| 35 return 5; | 35 return 5; |
| 36 } | 36 } |
| 37 | 37 |
| 38 void BalloonCollectionImpl::PositionBalloons(bool reposition) { | 38 void BalloonCollectionImpl::PositionBalloons(bool reposition) { |
| 39 PositionBalloonsInternal(reposition); | 39 PositionBalloonsInternal(reposition); |
| 40 } | 40 } |
| 41 | 41 |
| 42 #if defined(TOUCH_UI) || defined(USE_AURA) |
| 43 void BalloonCollectionImpl::DidProcessEvent(const base::NativeEvent& event) { |
| 44 NOTIMPLEMENTED(); |
| 45 } |
| 46 #else |
| 42 void BalloonCollectionImpl::DidProcessEvent(GdkEvent* event) { | 47 void BalloonCollectionImpl::DidProcessEvent(GdkEvent* event) { |
| 43 switch (event->type) { | 48 switch (event->type) { |
| 44 case GDK_MOTION_NOTIFY: | 49 case GDK_MOTION_NOTIFY: |
| 45 case GDK_LEAVE_NOTIFY: | 50 case GDK_LEAVE_NOTIFY: |
| 46 HandleMouseMoveEvent(); | 51 HandleMouseMoveEvent(); |
| 47 break; | 52 break; |
| 48 default: | 53 default: |
| 49 break; | 54 break; |
| 50 } | 55 } |
| 51 } | 56 } |
| 57 #endif |
| 52 | 58 |
| 53 bool BalloonCollectionImpl::IsCursorInBalloonCollection() const { | 59 bool BalloonCollectionImpl::IsCursorInBalloonCollection() const { |
| 54 GdkScreen* screen = gdk_screen_get_default(); | 60 GdkScreen* screen = gdk_screen_get_default(); |
| 55 GdkDisplay* display = gdk_screen_get_display(screen); | 61 GdkDisplay* display = gdk_screen_get_display(screen); |
| 56 gint x, y; | 62 gint x, y; |
| 57 gdk_display_get_pointer(display, NULL, &x, &y, NULL); | 63 gdk_display_get_pointer(display, NULL, &x, &y, NULL); |
| 58 gfx::Point cursor(x, y); | 64 gfx::Point cursor(x, y); |
| 59 | 65 |
| 60 return GetBalloonsBoundingBox().Contains(cursor); | 66 return GetBalloonsBoundingBox().Contains(cursor); |
| 61 } | 67 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 78 else | 84 else |
| 79 NOTREACHED(); | 85 NOTREACHED(); |
| 80 | 86 |
| 81 PositionBalloons(true); | 87 PositionBalloons(true); |
| 82 } | 88 } |
| 83 | 89 |
| 84 // static | 90 // static |
| 85 BalloonCollection* BalloonCollection::Create() { | 91 BalloonCollection* BalloonCollection::Create() { |
| 86 return new BalloonCollectionImpl(); | 92 return new BalloonCollectionImpl(); |
| 87 } | 93 } |
| OLD | NEW |