| 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 #ifndef CHROME_BROWSER_UI_VIEWS_STATUS_BUBBLE_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_STATUS_BUBBLE_VIEWS_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_STATUS_BUBBLE_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_STATUS_BUBBLE_VIEWS_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 class StatusBubbleViews : public StatusBubble { | 28 class StatusBubbleViews : public StatusBubble { |
| 29 public: | 29 public: |
| 30 // How wide the bubble's shadow is. | 30 // How wide the bubble's shadow is. |
| 31 static const int kShadowThickness; | 31 static const int kShadowThickness; |
| 32 | 32 |
| 33 // The combined vertical padding above and below the text. | 33 // The combined vertical padding above and below the text. |
| 34 static const int kTotalVerticalPadding = 7; | 34 static const int kTotalVerticalPadding = 7; |
| 35 | 35 |
| 36 // |base_view| is the view that this bubble is positioned relative to. | 36 // |base_view| is the view that this bubble is positioned relative to. |
| 37 explicit StatusBubbleViews(views::View* base_view); | 37 explicit StatusBubbleViews(views::View* base_view); |
| 38 virtual ~StatusBubbleViews(); | 38 ~StatusBubbleViews() override; |
| 39 | 39 |
| 40 views::View* base_view() { return base_view_; } | 40 views::View* base_view() { return base_view_; } |
| 41 | 41 |
| 42 // Reposition the bubble's popup - as we are using a WS_POPUP for the bubble, | 42 // Reposition the bubble's popup - as we are using a WS_POPUP for the bubble, |
| 43 // we have to manually position it when the browser window moves. | 43 // we have to manually position it when the browser window moves. |
| 44 void RepositionPopup(); | 44 void RepositionPopup(); |
| 45 | 45 |
| 46 // The bubble only has a preferred height: the sum of the height of | 46 // The bubble only has a preferred height: the sum of the height of |
| 47 // the font and kTotalVerticalPadding. | 47 // the font and kTotalVerticalPadding. |
| 48 gfx::Size GetPreferredSize(); | 48 gfx::Size GetPreferredSize(); |
| 49 | 49 |
| 50 // Calculate and set new position for status bubble. | 50 // Calculate and set new position for status bubble. |
| 51 void Reposition(); | 51 void Reposition(); |
| 52 | 52 |
| 53 // Set bubble to new width. | 53 // Set bubble to new width. |
| 54 void SetBubbleWidth(int width); | 54 void SetBubbleWidth(int width); |
| 55 | 55 |
| 56 // Overridden from StatusBubble: | 56 // Overridden from StatusBubble: |
| 57 virtual void SetStatus(const base::string16& status) override; | 57 void SetStatus(const base::string16& status) override; |
| 58 virtual void SetURL(const GURL& url, const std::string& languages) override; | 58 void SetURL(const GURL& url, const std::string& languages) override; |
| 59 virtual void Hide() override; | 59 void Hide() override; |
| 60 virtual void MouseMoved(const gfx::Point& location, | 60 void MouseMoved(const gfx::Point& location, bool left_content) override; |
| 61 bool left_content) override; | 61 void UpdateDownloadShelfVisibility(bool visible) override; |
| 62 virtual void UpdateDownloadShelfVisibility(bool visible) override; | |
| 63 | 62 |
| 64 views::Widget* GetPopupForTest() { return popup(); } | 63 views::Widget* GetPopupForTest() { return popup(); } |
| 65 | 64 |
| 66 protected: | 65 protected: |
| 67 views::Widget* popup() { return popup_.get(); } | 66 views::Widget* popup() { return popup_.get(); } |
| 68 | 67 |
| 69 private: | 68 private: |
| 70 class StatusView; | 69 class StatusView; |
| 71 class StatusViewAnimation; | 70 class StatusViewAnimation; |
| 72 class StatusViewExpander; | 71 class StatusViewExpander; |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // change size immediately, with no hover. | 143 // change size immediately, with no hover. |
| 145 bool is_expanded_; | 144 bool is_expanded_; |
| 146 | 145 |
| 147 // Times expansion of status bubble when URL is too long for standard width. | 146 // Times expansion of status bubble when URL is too long for standard width. |
| 148 base::WeakPtrFactory<StatusBubbleViews> expand_timer_factory_; | 147 base::WeakPtrFactory<StatusBubbleViews> expand_timer_factory_; |
| 149 | 148 |
| 150 DISALLOW_COPY_AND_ASSIGN(StatusBubbleViews); | 149 DISALLOW_COPY_AND_ASSIGN(StatusBubbleViews); |
| 151 }; | 150 }; |
| 152 | 151 |
| 153 #endif // CHROME_BROWSER_UI_VIEWS_STATUS_BUBBLE_VIEWS_H_ | 152 #endif // CHROME_BROWSER_UI_VIEWS_STATUS_BUBBLE_VIEWS_H_ |
| OLD | NEW |