| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef UI_MESSAGE_CENTER_VIEWS_POPUP_ALIGNMENT_DELEGATE_H_ | 5 #ifndef UI_MESSAGE_CENTER_VIEWS_POPUP_ALIGNMENT_DELEGATE_H_ |
| 6 #define UI_MESSAGE_CENTER_VIEWS_POPUP_ALIGNMENT_DELEGATE_H_ | 6 #define UI_MESSAGE_CENTER_VIEWS_POPUP_ALIGNMENT_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "ui/message_center/message_center_export.h" | 8 #include "ui/message_center/message_center_export.h" |
| 9 | 9 |
| 10 namespace gfx { | 10 namespace gfx { |
| 11 class Display; | 11 class Display; |
| 12 class Point; | 12 class Point; |
| 13 class Rect; | 13 class Rect; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace display { |
| 17 using Display = gfx::Display; |
| 18 } |
| 19 |
| 16 namespace message_center { | 20 namespace message_center { |
| 17 | 21 |
| 18 class MessagePopupCollection; | 22 class MessagePopupCollection; |
| 19 | 23 |
| 20 class MESSAGE_CENTER_EXPORT PopupAlignmentDelegate { | 24 class MESSAGE_CENTER_EXPORT PopupAlignmentDelegate { |
| 21 public: | 25 public: |
| 22 PopupAlignmentDelegate(); | 26 PopupAlignmentDelegate(); |
| 23 | 27 |
| 24 void set_collection(MessagePopupCollection* collection) { | 28 void set_collection(MessagePopupCollection* collection) { |
| 25 collection_ = collection; | 29 collection_ = collection; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 38 // Returns true if the toast should be aligned top down. | 42 // Returns true if the toast should be aligned top down. |
| 39 virtual bool IsTopDown() const = 0; | 43 virtual bool IsTopDown() const = 0; |
| 40 | 44 |
| 41 // Returns true if the toasts are positioned at the left side of the desktop | 45 // Returns true if the toasts are positioned at the left side of the desktop |
| 42 // so that their reveal animation should happen from left side. | 46 // so that their reveal animation should happen from left side. |
| 43 virtual bool IsFromLeft() const = 0; | 47 virtual bool IsFromLeft() const = 0; |
| 44 | 48 |
| 45 // Called when a new toast appears or toasts are rearranged in the |display|. | 49 // Called when a new toast appears or toasts are rearranged in the |display|. |
| 46 // The subclass may override this method to check the current desktop status | 50 // The subclass may override this method to check the current desktop status |
| 47 // so that the toasts are arranged at the correct place. | 51 // so that the toasts are arranged at the correct place. |
| 48 virtual void RecomputeAlignment(const gfx::Display& display) = 0; | 52 virtual void RecomputeAlignment(const display::Display& display) = 0; |
| 49 | 53 |
| 50 protected: | 54 protected: |
| 51 virtual ~PopupAlignmentDelegate(); | 55 virtual ~PopupAlignmentDelegate(); |
| 52 | 56 |
| 53 void DoUpdateIfPossible(); | 57 void DoUpdateIfPossible(); |
| 54 | 58 |
| 55 private: | 59 private: |
| 56 MessagePopupCollection* collection_; | 60 MessagePopupCollection* collection_; |
| 57 }; | 61 }; |
| 58 | 62 |
| 59 } // namespace message_center | 63 } // namespace message_center |
| 60 | 64 |
| 61 #endif // UI_MESSAGE_CENTER_VIEWS_POPUP_ALIGNMENT_DELEGATE_H_ | 65 #endif // UI_MESSAGE_CENTER_VIEWS_POPUP_ALIGNMENT_DELEGATE_H_ |
| OLD | NEW |