OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/alternate_nav_url_fetcher.h" | 5 #include "chrome/browser/alternate_nav_url_fetcher.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/infobars/infobar_tab_helper.h" |
8 #include "chrome/browser/intranet_redirect_detector.h" | 9 #include "chrome/browser/intranet_redirect_detector.h" |
9 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 11 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
11 #include "content/browser/tab_contents/navigation_controller.h" | 12 #include "content/browser/tab_contents/navigation_controller.h" |
12 #include "content/browser/tab_contents/navigation_entry.h" | 13 #include "content/browser/tab_contents/navigation_entry.h" |
13 #include "content/common/notification_service.h" | 14 #include "content/common/notification_service.h" |
14 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
15 #include "grit/theme_resources_standard.h" | 16 #include "grit/theme_resources_standard.h" |
16 #include "net/base/registry_controlled_domain.h" | 17 #include "net/base/registry_controlled_domain.h" |
17 #include "net/url_request/url_request.h" | 18 #include "net/url_request/url_request.h" |
(...skipping 141 matching lines...) Loading... |
159 void AlternateNavURLFetcher::ShowInfobarIfPossible() { | 160 void AlternateNavURLFetcher::ShowInfobarIfPossible() { |
160 if (!navigated_to_entry_ || state_ != SUCCEEDED) { | 161 if (!navigated_to_entry_ || state_ != SUCCEEDED) { |
161 if (state_ == FAILED) | 162 if (state_ == FAILED) |
162 delete this; | 163 delete this; |
163 return; | 164 return; |
164 } | 165 } |
165 | 166 |
166 infobar_contents_ = controller_->tab_contents(); | 167 infobar_contents_ = controller_->tab_contents(); |
167 StoreActiveEntryUniqueID(infobar_contents_); | 168 StoreActiveEntryUniqueID(infobar_contents_); |
168 TabContentsWrapper::GetCurrentWrapperForContents(infobar_contents_)-> | 169 TabContentsWrapper::GetCurrentWrapperForContents(infobar_contents_)-> |
169 AddInfoBar(this); | 170 infobar_tab_helper()->AddInfoBar(this); |
170 } | 171 } |
OLD | NEW |