| 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/omnibox_navigation_observer.h" | 5 #include "chrome/browser/ui/omnibox/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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 fetcher_->Start(); | 130 fetcher_->Start(); |
| 131 } else { | 131 } else { |
| 132 delete this; | 132 delete this; |
| 133 } | 133 } |
| 134 } | 134 } |
| 135 | 135 |
| 136 void OmniboxNavigationObserver::DidFailProvisionalLoad( | 136 void OmniboxNavigationObserver::DidFailProvisionalLoad( |
| 137 content::RenderFrameHost* render_frame_host, | 137 content::RenderFrameHost* render_frame_host, |
| 138 const GURL& validated_url, | 138 const GURL& validated_url, |
| 139 int error_code, | 139 int error_code, |
| 140 const base::string16& error_description) { | 140 const base::string16& error_description, |
| 141 bool was_ignored_by_handler) { |
| 141 if ((load_state_ != LOAD_COMMITTED) && !render_frame_host->GetParent()) | 142 if ((load_state_ != LOAD_COMMITTED) && !render_frame_host->GetParent()) |
| 142 delete this; | 143 delete this; |
| 143 } | 144 } |
| 144 | 145 |
| 145 void OmniboxNavigationObserver::NavigationEntryCommitted( | 146 void OmniboxNavigationObserver::NavigationEntryCommitted( |
| 146 const content::LoadCommittedDetails& load_details) { | 147 const content::LoadCommittedDetails& load_details) { |
| 147 load_state_ = LOAD_COMMITTED; | 148 load_state_ = LOAD_COMMITTED; |
| 148 if (ResponseCodeIndicatesSuccess(load_details.http_status_code) && | 149 if (ResponseCodeIndicatesSuccess(load_details.http_status_code) && |
| 149 IsValidNavigation(match_.destination_url, | 150 IsValidNavigation(match_.destination_url, |
| 150 load_details.entry->GetVirtualURL())) | 151 load_details.entry->GetVirtualURL())) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 173 OnAllLoadingFinished(); // deletes |this|! | 174 OnAllLoadingFinished(); // deletes |this|! |
| 174 } | 175 } |
| 175 | 176 |
| 176 void OmniboxNavigationObserver::OnAllLoadingFinished() { | 177 void OmniboxNavigationObserver::OnAllLoadingFinished() { |
| 177 if (fetch_state_ == FETCH_SUCCEEDED) { | 178 if (fetch_state_ == FETCH_SUCCEEDED) { |
| 178 AlternateNavInfoBarDelegate::Create( | 179 AlternateNavInfoBarDelegate::Create( |
| 179 web_contents(), text_, alternate_nav_match_, match_.destination_url); | 180 web_contents(), text_, alternate_nav_match_, match_.destination_url); |
| 180 } | 181 } |
| 181 delete this; | 182 delete this; |
| 182 } | 183 } |
| OLD | NEW |