| Index: chrome/browser/google/google_url_tracker.h
|
| diff --git a/chrome/browser/google/google_url_tracker.h b/chrome/browser/google/google_url_tracker.h
|
| index ab930003369eb8a6b51b4177d195f2914145e5b8..bce07e4cfa7f7ba208a6fbbf671525cc0940943e 100644
|
| --- a/chrome/browser/google/google_url_tracker.h
|
| +++ b/chrome/browser/google/google_url_tracker.h
|
| @@ -10,6 +10,7 @@
|
| #include <utility>
|
|
|
| #include "base/callback_forward.h"
|
| +#include "base/callback_list.h"
|
| #include "base/gtest_prod_util.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/memory/weak_ptr.h"
|
| @@ -49,6 +50,12 @@ class GoogleURLTracker : public net::URLFetcherDelegate,
|
| public net::NetworkChangeNotifier::IPAddressObserver,
|
| public KeyedService {
|
| public:
|
| + // Callback that is called when the Google URL is updated. The arguments are
|
| + // the old and new URLs.
|
| + typedef base::Callback<void(GURL, GURL)> OnGoogleURLUpdatedCallback;
|
| + typedef base::CallbackList<void(GURL, GURL)> CallbackList;
|
| + typedef CallbackList::Subscription Subscription;
|
| +
|
| // The contents of the Details for a NOTIFICATION_GOOGLE_URL_UPDATED.
|
| typedef std::pair<GURL, GURL> UpdatedDetails;
|
|
|
| @@ -59,6 +66,9 @@ class GoogleURLTracker : public net::URLFetcherDelegate,
|
| UNIT_TEST_MODE,
|
| };
|
|
|
| + static const char kDefaultGoogleHomepage[];
|
| + static const char kSearchDomainCheckURL[];
|
| +
|
| // Only the GoogleURLTrackerFactory and tests should call this. No code other
|
| // than the GoogleURLTracker itself should actually use
|
| // GoogleURLTrackerFactory::GetForProfile().
|
| @@ -125,8 +135,8 @@ class GoogleURLTracker : public net::URLFetcherDelegate,
|
| virtual void OnTabClosed(
|
| content::NavigationController* navigation_controller);
|
|
|
| - static const char kDefaultGoogleHomepage[];
|
| - static const char kSearchDomainCheckURL[];
|
| + scoped_ptr<Subscription> RegisterCallback(
|
| + const OnGoogleURLUpdatedCallback& cb);
|
|
|
| private:
|
| friend class GoogleURLTrackerTest;
|
| @@ -175,6 +185,10 @@ class GoogleURLTracker : public net::URLFetcherDelegate,
|
| const GoogleURLTrackerMapEntry& map_entry,
|
| bool must_be_listening_for_commit);
|
|
|
| + void NotifyGoogleURLUpdated(GURL old_url, GURL new_url);
|
| +
|
| + CallbackList callback_list_;
|
| +
|
| Profile* profile_;
|
|
|
| scoped_ptr<GoogleURLTrackerNavigationHelper> nav_helper_;
|
|
|