[email protected] | efa71ab2 | 2010-05-14 18:06:18 | [diff] [blame] | 1 | // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
[email protected] | feb3cf7 | 2009-01-22 22:57:19 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #ifndef CHROME_BROWSER_STATUS_BUBBLE_H_ | ||||
6 | #define CHROME_BROWSER_STATUS_BUBBLE_H_ | ||||
[email protected] | 32b76ef | 2010-07-26 23:08:24 | [diff] [blame] | 7 | #pragma once |
[email protected] | feb3cf7 | 2009-01-22 22:57:19 | [diff] [blame] | 8 | |
[email protected] | 43d259d | 2010-09-03 21:37:46 | [diff] [blame] | 9 | #include "base/string16.h" |
[email protected] | 51096b3 | 2009-01-22 23:09:44 | [diff] [blame] | 10 | |
[email protected] | feb3cf7 | 2009-01-22 22:57:19 | [diff] [blame] | 11 | class GURL; |
[email protected] | b8595e9 | 2009-11-14 01:18:00 | [diff] [blame] | 12 | namespace gfx { |
13 | class Point; | ||||
14 | } | ||||
[email protected] | feb3cf7 | 2009-01-22 22:57:19 | [diff] [blame] | 15 | |
16 | //////////////////////////////////////////////////////////////////////////////// | ||||
17 | // StatusBubble interface | ||||
18 | // An interface implemented by an object providing the status display area of | ||||
19 | // the browser window. | ||||
20 | // | ||||
21 | class StatusBubble { | ||||
22 | public: | ||||
[email protected] | efa71ab2 | 2010-05-14 18:06:18 | [diff] [blame] | 23 | // On hover, expand status bubble to fit long URL after this delay. |
24 | static const int kExpandHoverDelay = 1600; | ||||
25 | |||||
[email protected] | cbd7dcc7 | 2009-10-21 21:30:41 | [diff] [blame] | 26 | virtual ~StatusBubble() {} |
[email protected] | c9b0cbd | 2009-04-13 12:53:03 | [diff] [blame] | 27 | |
[email protected] | feb3cf7 | 2009-01-22 22:57:19 | [diff] [blame] | 28 | // Sets the bubble contents to a specific string and causes the bubble |
29 | // to display immediately. Subsequent empty SetURL calls (typically called | ||||
30 | // when the cursor exits a link) will set the status bubble back to its | ||||
31 | // status text. To hide the status bubble again, either call SetStatus | ||||
32 | // with an empty string, or call Hide(). | ||||
[email protected] | 43d259d | 2010-09-03 21:37:46 | [diff] [blame] | 33 | virtual void SetStatus(const string16& status) = 0; |
[email protected] | feb3cf7 | 2009-01-22 22:57:19 | [diff] [blame] | 34 | |
35 | // Sets the bubble text to a URL - if given a non-empty URL, this will cause | ||||
36 | // the bubble to fade in and remain open until given an empty URL or until | ||||
37 | // the Hide() method is called. languages is the value of Accept-Language | ||||
38 | // to determine what characters are understood by a user. | ||||
[email protected] | 43d259d | 2010-09-03 21:37:46 | [diff] [blame] | 39 | virtual void SetURL(const GURL& url, const string16& languages) = 0; |
[email protected] | feb3cf7 | 2009-01-22 22:57:19 | [diff] [blame] | 40 | |
41 | // Skip the fade and instant-hide the bubble. | ||||
42 | virtual void Hide() = 0; | ||||
43 | |||||
44 | // Called when the user's mouse has moved over web content. This is used to | ||||
45 | // determine when the status area should move out of the way of the user's | ||||
46 | // mouse. This may be windows specific pain due to the way messages are | ||||
[email protected] | b8595e9 | 2009-11-14 01:18:00 | [diff] [blame] | 47 | // processed for child HWNDs. |position| is the absolute position of the |
48 | // pointer, and |left_content| is true if the mouse just left the content | ||||
49 | // area. | ||||
50 | virtual void MouseMoved(const gfx::Point& position, bool left_content) = 0; | ||||
[email protected] | 3a6a3b6 | 2009-05-27 21:36:20 | [diff] [blame] | 51 | |
52 | // Called when the download shelf becomes visible or invisible. | ||||
53 | // This is used by to ensure that the status bubble does not obscure | ||||
54 | // the download shelf, when it is visible. | ||||
55 | virtual void UpdateDownloadShelfVisibility(bool visible) = 0; | ||||
[email protected] | feb3cf7 | 2009-01-22 22:57:19 | [diff] [blame] | 56 | }; |
57 | |||||
[email protected] | 11f485728 | 2009-11-13 19:56:17 | [diff] [blame] | 58 | #endif // CHROME_BROWSER_STATUS_BUBBLE_H_ |