| 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/infobars/infobar_tab_helper.h" |
| 9 #include "chrome/browser/intranet_redirect_detector.h" | 9 #include "chrome/browser/intranet_redirect_detector.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 return UTF8ToUTF16(alternate_nav_url_.spec()); | 72 return UTF8ToUTF16(alternate_nav_url_.spec()); |
| 73 } | 73 } |
| 74 | 74 |
| 75 bool AlternateNavInfoBarDelegate::LinkClicked( | 75 bool AlternateNavInfoBarDelegate::LinkClicked( |
| 76 WindowOpenDisposition disposition) { | 76 WindowOpenDisposition disposition) { |
| 77 owner()->tab_contents()->OpenURL( | 77 owner()->tab_contents()->OpenURL( |
| 78 alternate_nav_url_, GURL(), disposition, | 78 alternate_nav_url_, GURL(), disposition, |
| 79 // Pretend the user typed this URL, so that navigating to | 79 // Pretend the user typed this URL, so that navigating to |
| 80 // it will be the default action when it's typed again in | 80 // it will be the default action when it's typed again in |
| 81 // the future. | 81 // the future. |
| 82 PageTransition::TYPED); | 82 content::PAGE_TRANSITION_TYPED); |
| 83 | 83 |
| 84 // We should always close, even if the navigation did not occur within this | 84 // We should always close, even if the navigation did not occur within this |
| 85 // TabContents. | 85 // TabContents. |
| 86 return true; | 86 return true; |
| 87 } | 87 } |
| 88 | 88 |
| 89 | 89 |
| 90 // AlternateNavURLFetcher ----------------------------------------------------- | 90 // AlternateNavURLFetcher ----------------------------------------------------- |
| 91 | 91 |
| 92 AlternateNavURLFetcher::AlternateNavURLFetcher( | 92 AlternateNavURLFetcher::AlternateNavURLFetcher( |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 return; | 219 return; |
| 220 } | 220 } |
| 221 | 221 |
| 222 InfoBarTabHelper* infobar_helper = | 222 InfoBarTabHelper* infobar_helper = |
| 223 TabContentsWrapper::GetCurrentWrapperForContents( | 223 TabContentsWrapper::GetCurrentWrapperForContents( |
| 224 controller_->tab_contents())->infobar_tab_helper(); | 224 controller_->tab_contents())->infobar_tab_helper(); |
| 225 infobar_helper->AddInfoBar( | 225 infobar_helper->AddInfoBar( |
| 226 new AlternateNavInfoBarDelegate(infobar_helper, alternate_nav_url_)); | 226 new AlternateNavInfoBarDelegate(infobar_helper, alternate_nav_url_)); |
| 227 delete this; | 227 delete this; |
| 228 } | 228 } |
| OLD | NEW |