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/ui/omnibox/chrome_omnibox_navigation_observer.h" | 5 #include "chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.h" |
6 | 6 |
7 #include "chrome/browser/autocomplete/shortcuts_backend_factory.h" | 7 #include "chrome/browser/autocomplete/shortcuts_backend_factory.h" |
8 #include "chrome/browser/infobars/infobar_service.h" | 8 #include "chrome/browser/infobars/infobar_service.h" |
9 #include "chrome/browser/intranet_redirect_detector.h" | 9 #include "chrome/browser/intranet_redirect_detector.h" |
10 #include "chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.h" | 10 #include "chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 fetcher_->SetRequestContext( | 120 fetcher_->SetRequestContext( |
121 content::BrowserContext::GetDefaultStoragePartition( | 121 content::BrowserContext::GetDefaultStoragePartition( |
122 controller->GetBrowserContext())->GetURLRequestContext()); | 122 controller->GetBrowserContext())->GetURLRequestContext()); |
123 } | 123 } |
124 WebContentsObserver::Observe(web_contents); | 124 WebContentsObserver::Observe(web_contents); |
125 // DidStartNavigationToPendingEntry() will be called for this load as well. | 125 // DidStartNavigationToPendingEntry() will be called for this load as well. |
126 } | 126 } |
127 | 127 |
128 void ChromeOmniboxNavigationObserver::DidStartNavigationToPendingEntry( | 128 void ChromeOmniboxNavigationObserver::DidStartNavigationToPendingEntry( |
129 const GURL& url, | 129 const GURL& url, |
130 content::NavigationController::ReloadType reload_type) { | 130 content::ReloadType reload_type) { |
131 if (load_state_ == LOAD_NOT_SEEN) { | 131 if (load_state_ == LOAD_NOT_SEEN) { |
132 load_state_ = LOAD_PENDING; | 132 load_state_ = LOAD_PENDING; |
133 if (fetcher_) | 133 if (fetcher_) |
134 fetcher_->Start(); | 134 fetcher_->Start(); |
135 } else { | 135 } else { |
136 delete this; | 136 delete this; |
137 } | 137 } |
138 } | 138 } |
139 | 139 |
140 void ChromeOmniboxNavigationObserver::DidFailProvisionalLoad( | 140 void ChromeOmniboxNavigationObserver::DidFailProvisionalLoad( |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 OnAllLoadingFinished(); // deletes |this|! | 179 OnAllLoadingFinished(); // deletes |this|! |
180 } | 180 } |
181 | 181 |
182 void ChromeOmniboxNavigationObserver::OnAllLoadingFinished() { | 182 void ChromeOmniboxNavigationObserver::OnAllLoadingFinished() { |
183 if (fetch_state_ == FETCH_SUCCEEDED) { | 183 if (fetch_state_ == FETCH_SUCCEEDED) { |
184 AlternateNavInfoBarDelegate::Create( | 184 AlternateNavInfoBarDelegate::Create( |
185 web_contents(), text_, alternate_nav_match_, match_.destination_url); | 185 web_contents(), text_, alternate_nav_match_, match_.destination_url); |
186 } | 186 } |
187 delete this; | 187 delete this; |
188 } | 188 } |
OLD | NEW |