| 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 // Handles the visible notification (or balloons). | 5 // Handles the visible notification (or balloons). |
| 6 | 6 |
| 7 #ifndef CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_IMPL_H_ | 7 #ifndef CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_IMPL_H_ |
| 8 #define CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_IMPL_H_ | 8 #define CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_IMPL_H_ |
| 9 #pragma once | 9 #pragma once |
| 10 | 10 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE; | 69 virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE; |
| 70 #elif defined(TOOLKIT_USES_GTK) | 70 #elif defined(TOOLKIT_USES_GTK) |
| 71 virtual void WillProcessEvent(GdkEvent* event) OVERRIDE; | 71 virtual void WillProcessEvent(GdkEvent* event) OVERRIDE; |
| 72 virtual void DidProcessEvent(GdkEvent* event) OVERRIDE; | 72 virtual void DidProcessEvent(GdkEvent* event) OVERRIDE; |
| 73 #endif | 73 #endif |
| 74 | 74 |
| 75 // base_ is embedded, so this is a simple accessor for the number of | 75 // base_ is embedded, so this is a simple accessor for the number of |
| 76 // balloons in the collection. | 76 // balloons in the collection. |
| 77 int count() const { return base_.count(); } | 77 int count() const { return base_.count(); } |
| 78 | 78 |
| 79 static int min_balloon_width() { return Layout::min_balloon_width(); } |
| 80 static int max_balloon_width() { return Layout::max_balloon_width(); } |
| 81 static int min_balloon_height() { return Layout::min_balloon_height(); } |
| 82 static int max_balloon_height() { return Layout::max_balloon_height(); } |
| 83 |
| 79 protected: | 84 protected: |
| 80 // Calculates layout values for the balloons including | 85 // Calculates layout values for the balloons including |
| 81 // the scaling, the max/min sizes, and the upper left corner of each. | 86 // the scaling, the max/min sizes, and the upper left corner of each. |
| 82 class Layout { | 87 class Layout { |
| 83 public: | 88 public: |
| 84 Layout(); | 89 Layout(); |
| 85 | 90 |
| 86 // These enumerations all are based on a screen orientation where | 91 // These enumerations all are based on a screen orientation where |
| 87 // the origin is the top-left. | 92 // the origin is the top-left. |
| 88 enum Placement { | 93 enum Placement { |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 base::WeakPtrFactory<BalloonCollectionImpl> reposition_factory_; | 238 base::WeakPtrFactory<BalloonCollectionImpl> reposition_factory_; |
| 234 | 239 |
| 235 // Is the balloon collection currently listening for UI events? | 240 // Is the balloon collection currently listening for UI events? |
| 236 bool added_as_message_loop_observer_; | 241 bool added_as_message_loop_observer_; |
| 237 #endif | 242 #endif |
| 238 | 243 |
| 239 DISALLOW_COPY_AND_ASSIGN(BalloonCollectionImpl); | 244 DISALLOW_COPY_AND_ASSIGN(BalloonCollectionImpl); |
| 240 }; | 245 }; |
| 241 | 246 |
| 242 #endif // CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_IMPL_H_ | 247 #endif // CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_IMPL_H_ |
| OLD | NEW |