| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_VIEWS_STATUS_BUBBLE_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_STATUS_BUBBLE_VIEWS_H_ |
| 6 #define CHROME_BROWSER_VIEWS_STATUS_BUBBLE_VIEWS_H_ | 6 #define CHROME_BROWSER_VIEWS_STATUS_BUBBLE_VIEWS_H_ |
| 7 | 7 |
| 8 #include "base/gfx/rect.h" | 8 #include "base/gfx/rect.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| 11 #include "chrome/browser/status_bubble.h" | 11 #include "chrome/browser/status_bubble.h" |
| 12 | 12 |
| 13 class GURL; | 13 class GURL; |
| 14 namespace gfx { |
| 15 class Point; |
| 16 } |
| 14 namespace views { | 17 namespace views { |
| 15 class Widget; | 18 class Widget; |
| 16 } | 19 } |
| 17 | 20 |
| 18 // StatusBubble displays a bubble of text that fades in, hovers over the | 21 // StatusBubble displays a bubble of text that fades in, hovers over the |
| 19 // browser chrome and fades away when not needed. It is primarily designed | 22 // browser chrome and fades away when not needed. It is primarily designed |
| 20 // to allow users to see where hovered links point to. | 23 // to allow users to see where hovered links point to. |
| 21 class StatusBubbleViews : public StatusBubble { | 24 class StatusBubbleViews : public StatusBubble { |
| 22 public: | 25 public: |
| 23 // How wide the bubble's shadow is. | 26 // How wide the bubble's shadow is. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 37 // the font and kTotalVerticalPadding. | 40 // the font and kTotalVerticalPadding. |
| 38 gfx::Size GetPreferredSize(); | 41 gfx::Size GetPreferredSize(); |
| 39 | 42 |
| 40 // Set the bounds of the bubble relative to the browser window. | 43 // Set the bounds of the bubble relative to the browser window. |
| 41 void SetBounds(int x, int y, int w, int h); | 44 void SetBounds(int x, int y, int w, int h); |
| 42 | 45 |
| 43 // Overridden from StatusBubble: | 46 // Overridden from StatusBubble: |
| 44 virtual void SetStatus(const std::wstring& status); | 47 virtual void SetStatus(const std::wstring& status); |
| 45 virtual void SetURL(const GURL& url, const std::wstring& languages); | 48 virtual void SetURL(const GURL& url, const std::wstring& languages); |
| 46 virtual void Hide(); | 49 virtual void Hide(); |
| 47 virtual void MouseMoved(); | 50 virtual void MouseMoved(const gfx::Point& location, bool left_content); |
| 48 virtual void UpdateDownloadShelfVisibility(bool visible); | 51 virtual void UpdateDownloadShelfVisibility(bool visible); |
| 49 | 52 |
| 50 private: | 53 private: |
| 51 class StatusView; | 54 class StatusView; |
| 52 | 55 |
| 53 // Initializes the popup and view. | 56 // Initializes the popup and view. |
| 54 void Init(); | 57 void Init(); |
| 55 | 58 |
| 56 // Attempt to move the status bubble out of the way of the cursor, allowing | 59 // Attempt to move the status bubble out of the way of the cursor, allowing |
| 57 // users to see links in the region normally occupied by the status bubble. | 60 // users to see links in the region normally occupied by the status bubble. |
| 58 void AvoidMouse(); | 61 void AvoidMouse(const gfx::Point& location); |
| 59 | 62 |
| 60 // Returns true if the frame_ is visible and not minimized. | 63 // Returns true if the frame_ is visible and not minimized. |
| 61 bool IsFrameVisible(); | 64 bool IsFrameVisible(); |
| 62 | 65 |
| 63 // The status text we want to display when there are no URLs to display. | 66 // The status text we want to display when there are no URLs to display. |
| 64 std::wstring status_text_; | 67 std::wstring status_text_; |
| 65 | 68 |
| 66 // The url we want to display when there is no status text to display. | 69 // The url we want to display when there is no status text to display. |
| 67 std::wstring url_text_; | 70 std::wstring url_text_; |
| 68 | 71 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 81 views::Widget* frame_; | 84 views::Widget* frame_; |
| 82 StatusView* view_; | 85 StatusView* view_; |
| 83 | 86 |
| 84 // If the download shelf is visible, do not obscure it. | 87 // If the download shelf is visible, do not obscure it. |
| 85 bool download_shelf_is_visible_; | 88 bool download_shelf_is_visible_; |
| 86 | 89 |
| 87 DISALLOW_COPY_AND_ASSIGN(StatusBubbleViews); | 90 DISALLOW_COPY_AND_ASSIGN(StatusBubbleViews); |
| 88 }; | 91 }; |
| 89 | 92 |
| 90 #endif // CHROME_BROWSER_VIEWS_STATUS_BUBBLE_VIEWS_H_ | 93 #endif // CHROME_BROWSER_VIEWS_STATUS_BUBBLE_VIEWS_H_ |
| OLD | NEW |