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_OMNIBOX_SEARCH_HINT_H_ | 5 #ifndef CHROME_BROWSER_OMNIBOX_SEARCH_HINT_H_ |
6 #define CHROME_BROWSER_OMNIBOX_SEARCH_HINT_H_ | 6 #define CHROME_BROWSER_OMNIBOX_SEARCH_HINT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 // Disables the hint infobar permanently, so that it does not show ever again. | 41 // Disables the hint infobar permanently, so that it does not show ever again. |
42 void DisableHint(); | 42 void DisableHint(); |
43 | 43 |
44 // Returns true if the profile and current environment make the showing of the | 44 // Returns true if the profile and current environment make the showing of the |
45 // hint infobar possible. | 45 // hint infobar possible. |
46 static bool IsEnabled(Profile* profile); | 46 static bool IsEnabled(Profile* profile); |
47 | 47 |
48 private: | 48 private: |
49 explicit OmniboxSearchHint(content::WebContents* web_contents); | 49 explicit OmniboxSearchHint(content::WebContents* web_contents); |
50 static int kUserDataKey; | |
51 friend class WebContentsUserData<OmniboxSearchHint>; | 50 friend class WebContentsUserData<OmniboxSearchHint>; |
52 | 51 |
53 void ShowInfoBar(); | 52 void ShowInfoBar(); |
54 | 53 |
55 content::NotificationRegistrar notification_registrar_; | 54 content::NotificationRegistrar notification_registrar_; |
56 | 55 |
57 // The contents we are associated with. | 56 // The contents we are associated with. |
58 content::WebContents* web_contents_; | 57 content::WebContents* web_contents_; |
59 | 58 |
60 // A map containing the URLs of the search engine for which we want to | 59 // A map containing the URLs of the search engine for which we want to |
61 // trigger the hint. | 60 // trigger the hint. |
62 std::map<std::string, int> search_engine_urls_; | 61 std::map<std::string, int> search_engine_urls_; |
63 | 62 |
64 DISALLOW_COPY_AND_ASSIGN(OmniboxSearchHint); | 63 DISALLOW_COPY_AND_ASSIGN(OmniboxSearchHint); |
65 }; | 64 }; |
66 | 65 |
67 #endif // CHROME_BROWSER_OMNIBOX_SEARCH_HINT_H_ | 66 #endif // CHROME_BROWSER_OMNIBOX_SEARCH_HINT_H_ |
OLD | NEW |