OLD | NEW |
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/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/autocomplete/autocomplete_classifier.h" | 10 #include "chrome/browser/autocomplete/autocomplete_classifier.h" |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 const NavigationEntry* visible_entry = | 257 const NavigationEntry* visible_entry = |
258 navigation_controller->GetVisibleEntry(); | 258 navigation_controller->GetVisibleEntry(); |
259 base::string16 unused; | 259 base::string16 unused; |
260 // Keep track that we've shown the origin chip on an interstitial so it | 260 // Keep track that we've shown the origin chip on an interstitial so it |
261 // can be shown even after the interstitial was dismissed, to avoid | 261 // can be shown even after the interstitial was dismissed, to avoid |
262 // showing the chip, removing it and then showing it again. | 262 // showing the chip, removing it and then showing it again. |
263 if (visible_entry && | 263 if (visible_entry && |
264 visible_entry->GetPageType() == content::PAGE_TYPE_INTERSTITIAL && | 264 visible_entry->GetPageType() == content::PAGE_TYPE_INTERSTITIAL && |
265 !pending_entry->GetExtraData(kInterstitialShownKey, &unused)) | 265 !pending_entry->GetExtraData(kInterstitialShownKey, &unused)) |
266 pending_entry->SetExtraData(kInterstitialShownKey, base::string16()); | 266 pending_entry->SetExtraData(kInterstitialShownKey, base::string16()); |
267 const content::PageTransition transition_type = | 267 const ui::PageTransition transition_type = |
268 pending_entry->GetTransitionType(); | 268 pending_entry->GetTransitionType(); |
269 if ((transition_type & content::PAGE_TRANSITION_TYPED) != 0 && | 269 if ((transition_type & ui::PAGE_TRANSITION_TYPED) != 0 && |
270 !pending_entry->GetExtraData(kInterstitialShownKey, &unused)) | 270 !pending_entry->GetExtraData(kInterstitialShownKey, &unused)) |
271 return false; | 271 return false; |
272 } | 272 } |
273 } | 273 } |
274 | 274 |
275 if (!delegate_->InTabbedBrowser() || !ShouldDisplayURL() || | 275 if (!delegate_->InTabbedBrowser() || !ShouldDisplayURL() || |
276 !url_replacement_enabled()) | 276 !url_replacement_enabled()) |
277 return false; | 277 return false; |
278 | 278 |
279 if (chrome::ShouldDisplayOriginChip()) | 279 if (chrome::ShouldDisplayOriginChip()) |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 if (entry && | 329 if (entry && |
330 google_util::StartsWithCommandLineGoogleBaseURL(entry->GetVirtualURL())) | 330 google_util::StartsWithCommandLineGoogleBaseURL(entry->GetVirtualURL())) |
331 return search_terms; | 331 return search_terms; |
332 | 332 |
333 // Otherwise, extract search terms for HTTPS pages that do not have a security | 333 // Otherwise, extract search terms for HTTPS pages that do not have a security |
334 // error. | 334 // error. |
335 ToolbarModel::SecurityLevel security_level = GetSecurityLevel(ignore_editing); | 335 ToolbarModel::SecurityLevel security_level = GetSecurityLevel(ignore_editing); |
336 return ((security_level == NONE) || (security_level == SECURITY_ERROR)) ? | 336 return ((security_level == NONE) || (security_level == SECURITY_ERROR)) ? |
337 base::string16() : search_terms; | 337 base::string16() : search_terms; |
338 } | 338 } |
OLD | NEW |