| 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> | |
| 9 #include <string> | |
| 10 | |
| 11 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 12 #include "content/public/browser/notification_observer.h" | 9 #include "content/public/browser/notification_observer.h" |
| 13 #include "content/public/browser/notification_registrar.h" | 10 #include "content/public/browser/notification_registrar.h" |
| 14 #include "content/public/browser/web_contents_user_data.h" | 11 #include "content/public/browser/web_contents_user_data.h" |
| 15 | 12 |
| 16 class Profile; | 13 class Profile; |
| 17 | 14 |
| 18 namespace content { | 15 namespace content { |
| 19 class WebContents; | 16 class WebContents; |
| 20 } | 17 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 43 void DisableHint(); | 40 void DisableHint(); |
| 44 | 41 |
| 45 // Returns true if the profile and current environment make the showing of the | 42 // Returns true if the profile and current environment make the showing of the |
| 46 // hint infobar possible. | 43 // hint infobar possible. |
| 47 static bool IsEnabled(Profile* profile); | 44 static bool IsEnabled(Profile* profile); |
| 48 | 45 |
| 49 private: | 46 private: |
| 50 explicit OmniboxSearchHint(content::WebContents* web_contents); | 47 explicit OmniboxSearchHint(content::WebContents* web_contents); |
| 51 friend class content::WebContentsUserData<OmniboxSearchHint>; | 48 friend class content::WebContentsUserData<OmniboxSearchHint>; |
| 52 | 49 |
| 53 void ShowInfoBar(); | |
| 54 | |
| 55 content::NotificationRegistrar notification_registrar_; | 50 content::NotificationRegistrar notification_registrar_; |
| 56 | 51 |
| 57 // The contents we are associated with. | 52 // The contents we are associated with. |
| 58 content::WebContents* web_contents_; | 53 content::WebContents* web_contents_; |
| 59 | 54 |
| 60 // A map containing the URLs of the search engine for which we want to | |
| 61 // trigger the hint. | |
| 62 std::map<std::string, int> search_engine_urls_; | |
| 63 | |
| 64 DISALLOW_COPY_AND_ASSIGN(OmniboxSearchHint); | 55 DISALLOW_COPY_AND_ASSIGN(OmniboxSearchHint); |
| 65 }; | 56 }; |
| 66 | 57 |
| 67 #endif // CHROME_BROWSER_OMNIBOX_SEARCH_HINT_H_ | 58 #endif // CHROME_BROWSER_OMNIBOX_SEARCH_HINT_H_ |
| OLD | NEW |