Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: chrome/browser/google/google_url_tracker.cc

Issue 183853011: Move TrimWhitespace to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/file_select_helper.cc ('k') | chrome/browser/google/google_util_chromeos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 // Don't update the URL if the request didn't succeed. 129 // Don't update the URL if the request didn't succeed.
130 if (!source->GetStatus().is_success() || (source->GetResponseCode() != 200)) { 130 if (!source->GetStatus().is_success() || (source->GetResponseCode() != 200)) {
131 already_fetched_ = false; 131 already_fetched_ = false;
132 return; 132 return;
133 } 133 }
134 134
135 // See if the response data was valid. It should be 135 // See if the response data was valid. It should be
136 // "<scheme>://[www.]google.<TLD>/". 136 // "<scheme>://[www.]google.<TLD>/".
137 std::string url_str; 137 std::string url_str;
138 source->GetResponseAsString(&url_str); 138 source->GetResponseAsString(&url_str);
139 TrimWhitespace(url_str, TRIM_ALL, &url_str); 139 base::TrimWhitespace(url_str, base::TRIM_ALL, &url_str);
140 GURL url(url_str); 140 GURL url(url_str);
141 if (!url.is_valid() || (url.path().length() > 1) || url.has_query() || 141 if (!url.is_valid() || (url.path().length() > 1) || url.has_query() ||
142 url.has_ref() || 142 url.has_ref() ||
143 !google_util::IsGoogleDomainUrl(url, google_util::DISALLOW_SUBDOMAIN, 143 !google_util::IsGoogleDomainUrl(url, google_util::DISALLOW_SUBDOMAIN,
144 google_util::DISALLOW_NON_STANDARD_PORTS)) 144 google_util::DISALLOW_NON_STANDARD_PORTS))
145 return; 145 return;
146 146
147 std::swap(url, fetched_google_url_); 147 std::swap(url, fetched_google_url_);
148 GURL last_prompted_url( 148 GURL last_prompted_url(
149 profile_->GetPrefs()->GetString(prefs::kLastPromptedGoogleURL)); 149 profile_->GetPrefs()->GetString(prefs::kLastPromptedGoogleURL));
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 i->second->navigation_controller())) { 418 i->second->navigation_controller())) {
419 DCHECK(nav_helper_->IsListeningForNavigationStart()); 419 DCHECK(nav_helper_->IsListeningForNavigationStart());
420 return; 420 return;
421 } 421 }
422 } 422 }
423 if (nav_helper_->IsListeningForNavigationStart()) { 423 if (nav_helper_->IsListeningForNavigationStart()) {
424 DCHECK(!search_committed_); 424 DCHECK(!search_committed_);
425 nav_helper_->SetListeningForNavigationStart(false); 425 nav_helper_->SetListeningForNavigationStart(false);
426 } 426 }
427 } 427 }
OLDNEW
« no previous file with comments | « chrome/browser/file_select_helper.cc ('k') | chrome/browser/google/google_util_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698