| 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 "chrome/browser/ui/views/notifications/balloon_view.h" | 8 #include "chrome/browser/ui/views/notifications/balloon_view.h" |
| 9 #include "ui/base/events.h" | 9 #include "ui/base/events.h" |
| 10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 void BalloonCollectionImpl::DidProcessEvent(const base::NativeEvent& event) { | 43 void BalloonCollectionImpl::DidProcessEvent(const base::NativeEvent& event) { |
| 44 #if defined(OS_WIN) | 44 #if defined(OS_WIN) |
| 45 switch (event.message) { | 45 switch (event.message) { |
| 46 case WM_MOUSEMOVE: | 46 case WM_MOUSEMOVE: |
| 47 case WM_MOUSELEAVE: | 47 case WM_MOUSELEAVE: |
| 48 case WM_NCMOUSELEAVE: | 48 case WM_NCMOUSELEAVE: |
| 49 HandleMouseMoveEvent(); | 49 HandleMouseMoveEvent(); |
| 50 break; | 50 break; |
| 51 } | 51 } |
| 52 #elif defined(USE_AURA) |
| 53 // This is deliberately used only in linux. For an aura build on windows, the |
| 54 // above block of code is fine. |
| 55 switch (ui::EventTypeFromNative(event)) { |
| 56 case ui::ET_MOUSE_MOVED: |
| 57 case ui::ET_MOUSE_DRAGGED: |
| 58 case ui::ET_MOUSE_EXITED: |
| 59 HandleMouseMoveEvent(); |
| 60 break; |
| 61 default: |
| 62 break; |
| 63 } |
| 52 #else | 64 #else |
| 53 NOTIMPLEMENTED(); | 65 NOTIMPLEMENTED(); |
| 54 #endif | 66 #endif |
| 55 } | 67 } |
| 56 | 68 |
| 57 bool BalloonCollectionImpl::IsCursorInBalloonCollection() const { | 69 bool BalloonCollectionImpl::IsCursorInBalloonCollection() const { |
| 58 #if defined(OS_WIN) | 70 #if defined(OS_WIN) |
| 59 DWORD pos = GetMessagePos(); | 71 DWORD pos = GetMessagePos(); |
| 60 gfx::Point cursor(pos); | 72 gfx::Point cursor(pos); |
| 61 #else | 73 #else |
| (...skipping 22 matching lines...) Expand all Loading... |
| 84 else | 96 else |
| 85 NOTREACHED(); | 97 NOTREACHED(); |
| 86 | 98 |
| 87 PositionBalloons(true); | 99 PositionBalloons(true); |
| 88 } | 100 } |
| 89 | 101 |
| 90 // static | 102 // static |
| 91 BalloonCollection* BalloonCollection::Create() { | 103 BalloonCollection* BalloonCollection::Create() { |
| 92 return new BalloonCollectionImpl(); | 104 return new BalloonCollectionImpl(); |
| 93 } | 105 } |
| OLD | NEW |