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/search/instant_controller.h" | 5 #include "chrome/browser/ui/search/instant_controller.h" |
6 | 6 |
7 #include <iterator> | 7 #include <iterator> |
8 | 8 |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 1616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1627 return INSTANT_FALLBACK_NONE; | 1627 return INSTANT_FALLBACK_NONE; |
1628 | 1628 |
1629 bool page_is_current = PageIsCurrent(overlay()); | 1629 bool page_is_current = PageIsCurrent(overlay()); |
1630 if (!page_is_current) | 1630 if (!page_is_current) |
1631 return DetermineFallbackReason(overlay(), GetInstantURL()); | 1631 return DetermineFallbackReason(overlay(), GetInstantURL()); |
1632 | 1632 |
1633 return INSTANT_FALLBACK_NONE; | 1633 return INSTANT_FALLBACK_NONE; |
1634 } | 1634 } |
1635 | 1635 |
1636 void InstantController::ResetInstantTab() { | 1636 void InstantController::ResetInstantTab() { |
1637 // Do not wire up the InstantTab in Incognito, to prevent it from sending data | 1637 if (!search_mode_.is_origin_default()) { |
1638 // to the page. | |
1639 if (!search_mode_.is_origin_default() && | |
1640 !browser_->profile()->IsOffTheRecord()) { | |
1641 content::WebContents* active_tab = browser_->GetActiveWebContents(); | 1638 content::WebContents* active_tab = browser_->GetActiveWebContents(); |
1642 if (!instant_tab_ || active_tab != instant_tab_->contents()) { | 1639 if (!instant_tab_ || active_tab != instant_tab_->contents()) { |
1643 instant_tab_.reset(new InstantTab(this)); | 1640 instant_tab_.reset(new InstantTab(this)); |
1644 instant_tab_->Init(active_tab); | 1641 instant_tab_->Init(active_tab); |
1645 UpdateInfoForInstantTab(); | 1642 UpdateInfoForInstantTab(); |
1646 use_tab_for_suggestions_ = true; | 1643 use_tab_for_suggestions_ = true; |
1647 } | 1644 } |
1648 | 1645 |
1649 // Hide the |overlay_| since we are now using |instant_tab_| instead. | 1646 // Hide the |overlay_| since we are now using |instant_tab_| instead. |
1650 HideOverlay(); | 1647 HideOverlay(); |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1859 result->transition = match.transition; | 1856 result->transition = match.transition; |
1860 result->relevance = match.relevance; | 1857 result->relevance = match.relevance; |
1861 result->autocomplete_match_index = autocomplete_match_index; | 1858 result->autocomplete_match_index = autocomplete_match_index; |
1862 | 1859 |
1863 DVLOG(1) << " " << result->relevance << " " | 1860 DVLOG(1) << " " << result->relevance << " " |
1864 << UTF8ToUTF16(AutocompleteMatchType::ToString(result->type)) << " " | 1861 << UTF8ToUTF16(AutocompleteMatchType::ToString(result->type)) << " " |
1865 << result->provider << " " << result->destination_url << " '" | 1862 << result->provider << " " << result->destination_url << " '" |
1866 << result->description << "' '" << result->search_query << "' " | 1863 << result->description << "' '" << result->search_query << "' " |
1867 << result->transition << " " << result->autocomplete_match_index; | 1864 << result->transition << " " << result->autocomplete_match_index; |
1868 } | 1865 } |
OLD | NEW |