| 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_DESKTOP_POPUP_ALIGNMENT_DELEGATE_H_ | 5 #ifndef UI_MESSAGE_CENTER_VIEWS_DESKTOP_POPUP_ALIGNMENT_DELEGATE_H_ |
| 6 #define UI_MESSAGE_CENTER_VIEWS_DESKTOP_POPUP_ALIGNMENT_DELEGATE_H_ | 6 #define UI_MESSAGE_CENTER_VIEWS_DESKTOP_POPUP_ALIGNMENT_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 void StartObserving(display::Screen* screen); | 32 void StartObserving(display::Screen* screen); |
| 33 | 33 |
| 34 // Overridden from PopupAlignmentDelegate: | 34 // Overridden from PopupAlignmentDelegate: |
| 35 int GetToastOriginX(const gfx::Rect& toast_bounds) const override; | 35 int GetToastOriginX(const gfx::Rect& toast_bounds) const override; |
| 36 int GetBaseLine() const override; | 36 int GetBaseLine() const override; |
| 37 int GetWorkAreaBottom() const override; | 37 int GetWorkAreaBottom() const override; |
| 38 bool IsTopDown() const override; | 38 bool IsTopDown() const override; |
| 39 bool IsFromLeft() const override; | 39 bool IsFromLeft() const override; |
| 40 void RecomputeAlignment(const display::Display& display) override; | 40 void RecomputeAlignment(const display::Display& display) override; |
| 41 void ConfigureWidgetInitParamsForContainer( |
| 42 views::Widget* widget, |
| 43 views::Widget::InitParams* init_params) override; |
| 41 | 44 |
| 42 private: | 45 private: |
| 43 friend class test::MessagePopupCollectionTest; | 46 friend class test::MessagePopupCollectionTest; |
| 44 | 47 |
| 45 enum PopupAlignment { | 48 enum PopupAlignment { |
| 46 POPUP_ALIGNMENT_TOP = 1 << 0, | 49 POPUP_ALIGNMENT_TOP = 1 << 0, |
| 47 POPUP_ALIGNMENT_LEFT = 1 << 1, | 50 POPUP_ALIGNMENT_LEFT = 1 << 1, |
| 48 POPUP_ALIGNMENT_BOTTOM = 1 << 2, | 51 POPUP_ALIGNMENT_BOTTOM = 1 << 2, |
| 49 POPUP_ALIGNMENT_RIGHT = 1 << 3, | 52 POPUP_ALIGNMENT_RIGHT = 1 << 3, |
| 50 }; | 53 }; |
| 51 | 54 |
| 52 // Overridden from display::DisplayObserver: | 55 // Overridden from display::DisplayObserver: |
| 53 void OnDisplayAdded(const display::Display& new_display) override; | 56 void OnDisplayAdded(const display::Display& new_display) override; |
| 54 void OnDisplayRemoved(const display::Display& old_display) override; | 57 void OnDisplayRemoved(const display::Display& old_display) override; |
| 55 void OnDisplayMetricsChanged(const display::Display& display, | 58 void OnDisplayMetricsChanged(const display::Display& display, |
| 56 uint32_t metrics) override; | 59 uint32_t metrics) override; |
| 57 | 60 |
| 58 int32_t alignment_; | 61 int32_t alignment_; |
| 59 int64_t display_id_; | 62 int64_t display_id_; |
| 60 display::Screen* screen_; | 63 display::Screen* screen_; |
| 61 gfx::Rect work_area_; | 64 gfx::Rect work_area_; |
| 62 | 65 |
| 63 DISALLOW_COPY_AND_ASSIGN(DesktopPopupAlignmentDelegate); | 66 DISALLOW_COPY_AND_ASSIGN(DesktopPopupAlignmentDelegate); |
| 64 }; | 67 }; |
| 65 | 68 |
| 66 } // namespace message_center | 69 } // namespace message_center |
| 67 | 70 |
| 68 #endif // UI_MESSAGE_CENTER_VIEWS_DESKTOP_POPUP_ALIGNMENT_DELEGATE_H_ | 71 #endif // UI_MESSAGE_CENTER_VIEWS_DESKTOP_POPUP_ALIGNMENT_DELEGATE_H_ |
| OLD | NEW |