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/intranet_redirect_detector.h" | 8 #include "chrome/browser/intranet_redirect_detector.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 10 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, | 54 registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, |
55 Source<NavigationController>(controller_)); | 55 Source<NavigationController>(controller_)); |
56 registrar_.Add(this, content::NOTIFICATION_TAB_CLOSED, | 56 registrar_.Add(this, content::NOTIFICATION_TAB_CLOSED, |
57 Source<NavigationController>(controller_)); | 57 Source<NavigationController>(controller_)); |
58 | 58 |
59 DCHECK_EQ(NOT_STARTED, state_); | 59 DCHECK_EQ(NOT_STARTED, state_); |
60 state_ = IN_PROGRESS; | 60 state_ = IN_PROGRESS; |
61 fetcher_.reset(new URLFetcher(GURL(alternate_nav_url_), | 61 fetcher_.reset(new URLFetcher(GURL(alternate_nav_url_), |
62 URLFetcher::HEAD, this)); | 62 URLFetcher::HEAD, this)); |
63 fetcher_->set_request_context( | 63 fetcher_->set_request_context( |
64 controller_->profile()->GetRequestContext()); | 64 controller_->browser_context()->GetRequestContext()); |
65 fetcher_->Start(); | 65 fetcher_->Start(); |
66 } | 66 } |
67 break; | 67 break; |
68 | 68 |
69 case content::NOTIFICATION_NAV_ENTRY_COMMITTED: | 69 case content::NOTIFICATION_NAV_ENTRY_COMMITTED: |
70 // The page was navigated, we can show the infobar now if necessary. | 70 // The page was navigated, we can show the infobar now if necessary. |
71 registrar_.Remove(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, | 71 registrar_.Remove(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, |
72 Source<NavigationController>(controller_)); | 72 Source<NavigationController>(controller_)); |
73 navigated_to_entry_ = true; | 73 navigated_to_entry_ = true; |
74 ShowInfobarIfPossible(); | 74 ShowInfobarIfPossible(); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 if (state_ == FAILED) | 161 if (state_ == FAILED) |
162 delete this; | 162 delete this; |
163 return; | 163 return; |
164 } | 164 } |
165 | 165 |
166 infobar_contents_ = controller_->tab_contents(); | 166 infobar_contents_ = controller_->tab_contents(); |
167 StoreActiveEntryUniqueID(infobar_contents_); | 167 StoreActiveEntryUniqueID(infobar_contents_); |
168 TabContentsWrapper::GetCurrentWrapperForContents(infobar_contents_)-> | 168 TabContentsWrapper::GetCurrentWrapperForContents(infobar_contents_)-> |
169 AddInfoBar(this); | 169 AddInfoBar(this); |
170 } | 170 } |
OLD | NEW |