| 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 #include "chrome/browser/google/google_url_tracker.h" | 5 #include "chrome/browser/google/google_url_tracker.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 profile_.GetPrefs()->SetString(prefs::kLastPromptedGoogleURL, url.spec()); | 357 profile_.GetPrefs()->SetString(prefs::kLastPromptedGoogleURL, url.spec()); |
| 358 } | 358 } |
| 359 | 359 |
| 360 GURL GoogleURLTrackerTest::GetLastPromptedGoogleURL() { | 360 GURL GoogleURLTrackerTest::GetLastPromptedGoogleURL() { |
| 361 return GURL(profile_.GetPrefs()->GetString(prefs::kLastPromptedGoogleURL)); | 361 return GURL(profile_.GetPrefs()->GetString(prefs::kLastPromptedGoogleURL)); |
| 362 } | 362 } |
| 363 | 363 |
| 364 void GoogleURLTrackerTest::SetNavigationPending(intptr_t unique_id, | 364 void GoogleURLTrackerTest::SetNavigationPending(intptr_t unique_id, |
| 365 bool is_search) { | 365 bool is_search) { |
| 366 if (is_search) { | 366 if (is_search) { |
| 367 google_url_tracker_->SearchCommitted(); | 367 google_url_tracker_->GoogleURLSearchCommitted(); |
| 368 // Note that the call above might not have actually registered a listener | 368 // Note that the call above might not have actually registered a listener |
| 369 // for navigation starts if the searchdomaincheck response was bogus. | 369 // for navigation starts if the searchdomaincheck response was bogus. |
| 370 } | 370 } |
| 371 unique_ids_seen_.insert(unique_id); | 371 unique_ids_seen_.insert(unique_id); |
| 372 if (client_->IsListeningForNavigationStart()) { | 372 if (client_->IsListeningForNavigationStart()) { |
| 373 google_url_tracker_->OnNavigationPending( | 373 google_url_tracker_->OnNavigationPending( |
| 374 scoped_ptr<GoogleURLTrackerNavigationHelper>( | 374 scoped_ptr<GoogleURLTrackerNavigationHelper>( |
| 375 new TestGoogleURLTrackerNavigationHelper( | 375 new TestGoogleURLTrackerNavigationHelper( |
| 376 google_url_tracker_.get())), | 376 google_url_tracker_.get())), |
| 377 reinterpret_cast<InfoBarService*>(unique_id), | 377 reinterpret_cast<InfoBarService*>(unique_id), |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1087 CommitSearch(2, GURL("http://www.google.co.uk/search?q=test2")); | 1087 CommitSearch(2, GURL("http://www.google.co.uk/search?q=test2")); |
| 1088 EXPECT_FALSE(GetInfoBarDelegate(1) == NULL); | 1088 EXPECT_FALSE(GetInfoBarDelegate(1) == NULL); |
| 1089 GoogleURLTrackerInfoBarDelegate* delegate2 = GetInfoBarDelegate(2); | 1089 GoogleURLTrackerInfoBarDelegate* delegate2 = GetInfoBarDelegate(2); |
| 1090 ASSERT_FALSE(delegate2 == NULL); | 1090 ASSERT_FALSE(delegate2 == NULL); |
| 1091 SetNavigationPending(1, true); | 1091 SetNavigationPending(1, true); |
| 1092 ASSERT_NO_FATAL_FAILURE(ExpectListeningForCommit(1, true)); | 1092 ASSERT_NO_FATAL_FAILURE(ExpectListeningForCommit(1, true)); |
| 1093 delegate2->Close(false); | 1093 delegate2->Close(false); |
| 1094 SetNavigationPending(1, false); | 1094 SetNavigationPending(1, false); |
| 1095 ASSERT_NO_FATAL_FAILURE(ExpectListeningForCommit(1, false)); | 1095 ASSERT_NO_FATAL_FAILURE(ExpectListeningForCommit(1, false)); |
| 1096 } | 1096 } |
| OLD | NEW |