OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "chrome/browser/profile.h" | 9 #include "chrome/browser/profile.h" |
10 #include "chrome/browser/tab_contents/navigation_controller.h" | 10 #include "chrome/browser/tab_contents/navigation_controller.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 // The following TLD+1s are used as destinations by ISPs/DNS providers/etc. | 91 // The following TLD+1s are used as destinations by ISPs/DNS providers/etc. |
92 // who return provider-controlled pages to arbitrary user navigation | 92 // who return provider-controlled pages to arbitrary user navigation |
93 // attempts. Because this can result in infobars on large fractions of user | 93 // attempts. Because this can result in infobars on large fractions of user |
94 // searches, we don't show automatic infobars for these. Note that users | 94 // searches, we don't show automatic infobars for these. Note that users |
95 // can still choose to explicitly navigate to or search for pages in these | 95 // can still choose to explicitly navigate to or search for pages in these |
96 // domains, and can still get infobars for cases that wind up on other | 96 // domains, and can still get infobars for cases that wind up on other |
97 // domains (e.g. legit intranet sites), we're just trying to avoid | 97 // domains (e.g. legit intranet sites), we're just trying to avoid |
98 // erroneously harassing the user with our own UI prompts. | 98 // erroneously harassing the user with our own UI prompts. |
99 const char* kBlacklistedSites[] = { | 99 const char* kBlacklistedSites[] = { |
100 "comcast.com", | 100 // NOTE: Use complete URLs, because GURL() doesn't do fixup! |
101 "opendns.com", | 101 "http://comcast.com/", |
102 "verizon.net", | 102 "http://opendns.com/", |
| 103 "http://verizon.net/", |
103 }; | 104 }; |
104 for (size_t i = 0; i < arraysize(kBlacklistedSites); ++i) { | 105 for (size_t i = 0; i < arraysize(kBlacklistedSites); ++i) { |
105 if (net::RegistryControlledDomainService::SameDomainOrHost( | 106 if (net::RegistryControlledDomainService::SameDomainOrHost( |
106 url, GURL(kBlacklistedSites[i]))) { | 107 url, GURL(kBlacklistedSites[i]))) { |
107 state_ = FAILED; | 108 state_ = FAILED; |
108 break; | 109 break; |
109 } | 110 } |
110 } | 111 } |
111 } else { | 112 } else { |
112 state_ = FAILED; | 113 state_ = FAILED; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 if (state_ == FAILED) | 155 if (state_ == FAILED) |
155 delete this; | 156 delete this; |
156 return; | 157 return; |
157 } | 158 } |
158 | 159 |
159 infobar_contents_ = controller_->tab_contents(); | 160 infobar_contents_ = controller_->tab_contents(); |
160 StoreActiveEntryUniqueID(infobar_contents_); | 161 StoreActiveEntryUniqueID(infobar_contents_); |
161 // We will be deleted when the InfoBar is destroyed. (See InfoBarClosed). | 162 // We will be deleted when the InfoBar is destroyed. (See InfoBarClosed). |
162 infobar_contents_->AddInfoBar(this); | 163 infobar_contents_->AddInfoBar(this); |
163 } | 164 } |
OLD | NEW |