OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_GOOGLE_GOOGLE_URL_TRACKER_H_ | 5 #ifndef CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_H_ |
6 #define CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_H_ | 6 #define CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" | 14 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" |
15 #include "content/public/common/url_fetcher_delegate.h" | 15 #include "content/public/common/url_fetcher_delegate.h" |
16 #include "content/public/browser/notification_observer.h" | 16 #include "content/public/browser/notification_observer.h" |
17 #include "content/public/browser/notification_registrar.h" | 17 #include "content/public/browser/notification_registrar.h" |
18 #include "googleurl/src/gurl.h" | 18 #include "googleurl/src/gurl.h" |
19 #include "net/base/network_change_notifier.h" | 19 #include "net/base/network_change_notifier.h" |
20 | 20 |
21 class NavigationController; | 21 class NavigationController; |
22 class PrefService; | 22 class PrefService; |
23 class TabContents; | 23 class TabContents; |
24 class TemplateURL; | |
25 | 24 |
26 // This object is responsible for checking the Google URL once per network | 25 // This object is responsible for checking the Google URL once per network |
27 // change, and if necessary prompting the user to see if they want to change to | 26 // change, and if necessary prompting the user to see if they want to change to |
28 // using it. The current and last prompted values are saved to prefs. | 27 // using it. The current and last prompted values are saved to prefs. |
29 // | 28 // |
30 // Most consumers should only call GoogleURL(), which is guaranteed to | 29 // Most consumers should only call GoogleURL(), which is guaranteed to |
31 // synchronously return a value at all times (even during startup or in unittest | 30 // synchronously return a value at all times (even during startup or in unittest |
32 // mode). Consumers who need to be notified when things change should listen to | 31 // mode). Consumers who need to be notified when things change should listen to |
33 // the notification service for NOTIFY_GOOGLE_URL_UPDATED, and call GoogleURL() | 32 // the notification service for NOTIFY_GOOGLE_URL_UPDATED, and call GoogleURL() |
34 // again after receiving it, in order to get the updated value. | 33 // again after receiving it, in order to get the updated value. |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 virtual string16 GetMessageText() const OVERRIDE; | 179 virtual string16 GetMessageText() const OVERRIDE; |
181 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; | 180 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; |
182 | 181 |
183 // Returns the portion of the appropriate hostname to display. | 182 // Returns the portion of the appropriate hostname to display. |
184 string16 GetHost(bool new_host) const; | 183 string16 GetHost(bool new_host) const; |
185 | 184 |
186 DISALLOW_COPY_AND_ASSIGN(GoogleURLTrackerInfoBarDelegate); | 185 DISALLOW_COPY_AND_ASSIGN(GoogleURLTrackerInfoBarDelegate); |
187 }; | 186 }; |
188 | 187 |
189 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_H_ | 188 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_H_ |
OLD | NEW |