OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_ANDROID_SEARCH_GEOLOCATION_SEARCH_GEOLOCATION_DISCLOSURE_
INFOBAR_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_SEARCH_GEOLOCATION_SEARCH_GEOLOCATION_DISCLOSURE_
INFOBAR_DELEGATE_H_ |
6 #define CHROME_BROWSER_ANDROID_SEARCH_GEOLOCATION_SEARCH_GEOLOCATION_DISCLOSURE_
INFOBAR_DELEGATE_H_ | 6 #define CHROME_BROWSER_ANDROID_SEARCH_GEOLOCATION_SEARCH_GEOLOCATION_DISCLOSURE_
INFOBAR_DELEGATE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 17 matching lines...) Expand all Loading... |
28 class WebContents; | 28 class WebContents; |
29 } | 29 } |
30 | 30 |
31 class SearchGeolocationDisclosureInfoBarDelegate | 31 class SearchGeolocationDisclosureInfoBarDelegate |
32 : public infobars::InfoBarDelegate { | 32 : public infobars::InfoBarDelegate { |
33 public: | 33 public: |
34 ~SearchGeolocationDisclosureInfoBarDelegate() override; | 34 ~SearchGeolocationDisclosureInfoBarDelegate() override; |
35 | 35 |
36 // Create and show the infobar. | 36 // Create and show the infobar. |
37 static void Create(content::WebContents* web_contents, | 37 static void Create(content::WebContents* web_contents, |
38 const GURL& search_url); | 38 const GURL& search_url, |
| 39 const base::string16& search_engine_name); |
39 | 40 |
40 // Determine if there is a search geolocation disclosure infobar already open. | 41 // Determine if there is a search geolocation disclosure infobar already open. |
41 static bool IsSearchGeolocationDisclosureOpen( | 42 static bool IsSearchGeolocationDisclosureOpen( |
42 content::WebContents* web_contents); | 43 content::WebContents* web_contents); |
43 | 44 |
44 void RecordSettingsClicked(); | 45 void RecordSettingsClicked(); |
45 | 46 |
46 // The translated text of the message to display. | 47 // The translated text of the message to display. |
47 const base::string16& message_text() const { return message_text_; } | 48 const base::string16& message_text() const { return message_text_; } |
48 | 49 |
49 // The range of the message that should be a link. | 50 // The range of the message that should be a link. |
50 const gfx::Range& inline_link_range() const { return inline_link_range_; } | 51 const gfx::Range& inline_link_range() const { return inline_link_range_; } |
51 | 52 |
52 // The search URL that caused this infobar to be displayed. | 53 // The search URL that caused this infobar to be displayed. |
53 const GURL& search_url() const { return search_url_; } | 54 const GURL& search_url() const { return search_url_; } |
54 | 55 |
55 private: | 56 private: |
56 enum class DisclosureResult; | 57 enum class DisclosureResult; |
57 | 58 |
58 explicit SearchGeolocationDisclosureInfoBarDelegate( | 59 explicit SearchGeolocationDisclosureInfoBarDelegate( |
59 content::WebContents* web_contents, | 60 content::WebContents* web_contents, |
60 const GURL& search_url); | 61 const GURL& search_url, |
| 62 const base::string16& search_engine_name); |
61 | 63 |
62 // InfoBarDelegate: | 64 // InfoBarDelegate: |
63 void InfoBarDismissed() override; | 65 void InfoBarDismissed() override; |
64 Type GetInfoBarType() const override; | 66 Type GetInfoBarType() const override; |
65 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; | 67 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; |
66 int GetIconId() const override; | 68 int GetIconId() const override; |
67 | 69 |
68 // The translated text of the message to display. | 70 // The translated text of the message to display. |
69 base::string16 message_text_; | 71 base::string16 message_text_; |
70 | 72 |
71 // The range of the message that should be a link. | 73 // The range of the message that should be a link. |
72 gfx::Range inline_link_range_; | 74 gfx::Range inline_link_range_; |
73 | 75 |
74 // The search URL that caused this infobar to be displayed. | 76 // The search URL that caused this infobar to be displayed. |
75 GURL search_url_; | 77 GURL search_url_; |
76 | 78 |
77 // The pref service to record prefs in. | 79 // The pref service to record prefs in. |
78 PrefService* pref_service_; | 80 PrefService* pref_service_; |
79 | 81 |
80 // The result of showing the disclosure. | 82 // The result of showing the disclosure. |
81 DisclosureResult result_; | 83 DisclosureResult result_; |
82 | 84 |
83 // The time the infobar was created. | 85 // The time the infobar was created. |
84 base::Time creation_time_; | 86 base::Time creation_time_; |
85 | 87 |
86 DISALLOW_COPY_AND_ASSIGN(SearchGeolocationDisclosureInfoBarDelegate); | 88 DISALLOW_COPY_AND_ASSIGN(SearchGeolocationDisclosureInfoBarDelegate); |
87 }; | 89 }; |
88 | 90 |
89 #endif // CHROME_BROWSER_ANDROID_SEARCH_GEOLOCATION_SEARCH_GEOLOCATION_DISCLOSU
RE_INFOBAR_DELEGATE_H_ | 91 #endif // CHROME_BROWSER_ANDROID_SEARCH_GEOLOCATION_SEARCH_GEOLOCATION_DISCLOSU
RE_INFOBAR_DELEGATE_H_ |
OLD | NEW |