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

Side by Side Diff: chrome/browser/ui/toolbar/toolbar_model_impl.cc

Issue 877163005: [Android] Fix new tab not to show 'about:blank' at the beginning (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/ui/toolbar/toolbar_model_impl.h" 5 #include "chrome/browser/ui/toolbar/toolbar_model_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 } 237 }
238 238
239 GURL ToolbarModelImpl::GetURL() const { 239 GURL ToolbarModelImpl::GetURL() const {
240 const NavigationController* navigation_controller = GetNavigationController(); 240 const NavigationController* navigation_controller = GetNavigationController();
241 if (navigation_controller) { 241 if (navigation_controller) {
242 const NavigationEntry* entry = navigation_controller->GetVisibleEntry(); 242 const NavigationEntry* entry = navigation_controller->GetVisibleEntry();
243 if (entry) 243 if (entry)
244 return ShouldDisplayURL() ? entry->GetVirtualURL() : GURL(); 244 return ShouldDisplayURL() ? entry->GetVirtualURL() : GURL();
245 } 245 }
246 246
247 return GURL(url::kAboutBlankURL); 247 return GURL();
Maria 2015/01/28 18:34:49 It seems like if no original url was set, we will
248 } 248 }
249 249
250 bool ToolbarModelImpl::WouldPerformSearchTermReplacement( 250 bool ToolbarModelImpl::WouldPerformSearchTermReplacement(
251 bool ignore_editing) const { 251 bool ignore_editing) const {
252 return !GetSearchTerms(ignore_editing).empty(); 252 return !GetSearchTerms(ignore_editing).empty();
253 } 253 }
254 254
255 ToolbarModel::SecurityLevel ToolbarModelImpl::GetSecurityLevel( 255 ToolbarModel::SecurityLevel ToolbarModelImpl::GetSecurityLevel(
256 bool ignore_editing) const { 256 bool ignore_editing) const {
257 // When editing, assume no security style. 257 // When editing, assume no security style.
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 if (entry && 418 if (entry &&
419 google_util::StartsWithCommandLineGoogleBaseURL(entry->GetVirtualURL())) 419 google_util::StartsWithCommandLineGoogleBaseURL(entry->GetVirtualURL()))
420 return search_terms; 420 return search_terms;
421 421
422 // Otherwise, extract search terms for HTTPS pages that do not have a security 422 // Otherwise, extract search terms for HTTPS pages that do not have a security
423 // error. 423 // error.
424 ToolbarModel::SecurityLevel security_level = GetSecurityLevel(ignore_editing); 424 ToolbarModel::SecurityLevel security_level = GetSecurityLevel(ignore_editing);
425 return ((security_level == NONE) || (security_level == SECURITY_ERROR)) ? 425 return ((security_level == NONE) || (security_level == SECURITY_ERROR)) ?
426 base::string16() : search_terms; 426 base::string16() : search_terms;
427 } 427 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698