| 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/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/api/infobars/link_infobar_delegate.h" | 8 #include "chrome/browser/api/infobars/link_infobar_delegate.h" |
| 9 #include "chrome/browser/infobars/infobar_tab_helper.h" | 9 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 10 #include "chrome/browser/intranet_redirect_detector.h" | 10 #include "chrome/browser/intranet_redirect_detector.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 bool AlternateNavInfoBarDelegate::LinkClicked( | 83 bool AlternateNavInfoBarDelegate::LinkClicked( |
| 84 WindowOpenDisposition disposition) { | 84 WindowOpenDisposition disposition) { |
| 85 OpenURLParams params( | 85 OpenURLParams params( |
| 86 alternate_nav_url_, Referrer(), disposition, | 86 alternate_nav_url_, Referrer(), disposition, |
| 87 // Pretend the user typed this URL, so that navigating to | 87 // Pretend the user typed this URL, so that navigating to |
| 88 // it will be the default action when it's typed again in | 88 // it will be the default action when it's typed again in |
| 89 // the future. | 89 // the future. |
| 90 content::PAGE_TRANSITION_TYPED, | 90 content::PAGE_TRANSITION_TYPED, |
| 91 false); | 91 false); |
| 92 owner()->web_contents()->OpenURL(params); | 92 owner()->GetWebContents()->OpenURL(params); |
| 93 | 93 |
| 94 // We should always close, even if the navigation did not occur within this | 94 // We should always close, even if the navigation did not occur within this |
| 95 // WebContents. | 95 // WebContents. |
| 96 return true; | 96 return true; |
| 97 } | 97 } |
| 98 | 98 |
| 99 | 99 |
| 100 // AlternateNavURLFetcher ----------------------------------------------------- | 100 // AlternateNavURLFetcher ----------------------------------------------------- |
| 101 | 101 |
| 102 AlternateNavURLFetcher::AlternateNavURLFetcher( | 102 AlternateNavURLFetcher::AlternateNavURLFetcher( |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 return; | 227 return; |
| 228 } | 228 } |
| 229 | 229 |
| 230 InfoBarTabHelper* infobar_helper = | 230 InfoBarTabHelper* infobar_helper = |
| 231 TabContents::FromWebContents(controller_->GetWebContents())-> | 231 TabContents::FromWebContents(controller_->GetWebContents())-> |
| 232 infobar_tab_helper(); | 232 infobar_tab_helper(); |
| 233 infobar_helper->AddInfoBar( | 233 infobar_helper->AddInfoBar( |
| 234 new AlternateNavInfoBarDelegate(infobar_helper, alternate_nav_url_)); | 234 new AlternateNavInfoBarDelegate(infobar_helper, alternate_nav_url_)); |
| 235 delete this; | 235 delete this; |
| 236 } | 236 } |
| OLD | NEW |