| 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 #include "chrome/browser/google/google_url_tracker.h" | 5 #include "chrome/browser/google/google_url_tracker.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 // static | 119 // static |
| 120 void GoogleURLTracker::RequestServerCheck() { | 120 void GoogleURLTracker::RequestServerCheck() { |
| 121 GoogleURLTracker* const tracker = g_browser_process->google_url_tracker(); | 121 GoogleURLTracker* const tracker = g_browser_process->google_url_tracker(); |
| 122 if (tracker) | 122 if (tracker) |
| 123 tracker->SetNeedToFetch(); | 123 tracker->SetNeedToFetch(); |
| 124 } | 124 } |
| 125 | 125 |
| 126 // static | 126 // static |
| 127 void GoogleURLTracker::RegisterPrefs(PrefService* prefs) { | 127 void GoogleURLTracker::RegisterPrefs(PrefService* prefs) { |
| 128 prefs->RegisterStringPref(prefs::kLastKnownGoogleURL, | 128 prefs->RegisterStringPref(prefs::kLastKnownGoogleURL, |
| 129 kDefaultGoogleHomepage); | 129 kDefaultGoogleHomepage, |
| 130 prefs->RegisterStringPref(prefs::kLastPromptedGoogleURL, std::string()); | 130 false /* don't sync pref */); |
| 131 prefs->RegisterStringPref(prefs::kLastPromptedGoogleURL, |
| 132 std::string(), |
| 133 false /* don't sync pref */); |
| 131 } | 134 } |
| 132 | 135 |
| 133 // static | 136 // static |
| 134 void GoogleURLTracker::GoogleURLSearchCommitted() { | 137 void GoogleURLTracker::GoogleURLSearchCommitted() { |
| 135 GoogleURLTracker* tracker = g_browser_process->google_url_tracker(); | 138 GoogleURLTracker* tracker = g_browser_process->google_url_tracker(); |
| 136 if (tracker) | 139 if (tracker) |
| 137 tracker->SearchCommitted(); | 140 tracker->SearchCommitted(); |
| 138 } | 141 } |
| 139 | 142 |
| 140 void GoogleURLTracker::SetNeedToFetch() { | 143 void GoogleURLTracker::SetNeedToFetch() { |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 } | 354 } |
| 352 | 355 |
| 353 void GoogleURLTracker::ShowGoogleURLInfoBarIfNecessary( | 356 void GoogleURLTracker::ShowGoogleURLInfoBarIfNecessary( |
| 354 TabContents* tab_contents) { | 357 TabContents* tab_contents) { |
| 355 if (!need_to_prompt_) | 358 if (!need_to_prompt_) |
| 356 return; | 359 return; |
| 357 DCHECK(!fetched_google_url_.is_empty()); | 360 DCHECK(!fetched_google_url_.is_empty()); |
| 358 | 361 |
| 359 infobar_ = (*infobar_creator_)(tab_contents, this, fetched_google_url_); | 362 infobar_ = (*infobar_creator_)(tab_contents, this, fetched_google_url_); |
| 360 } | 363 } |
| OLD | NEW |