OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/tab_contents/tab_contents.h" | 5 #include "chrome/browser/tab_contents/tab_contents.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 2119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2130 bool is_main_frame, | 2130 bool is_main_frame, |
2131 const GURL& url) { | 2131 const GURL& url) { |
2132 ProvisionalLoadDetails details(is_main_frame, | 2132 ProvisionalLoadDetails details(is_main_frame, |
2133 controller_.IsURLInPageNavigation(url), | 2133 controller_.IsURLInPageNavigation(url), |
2134 url, std::string(), false, frame_id); | 2134 url, std::string(), false, frame_id); |
2135 NotificationService::current()->Notify( | 2135 NotificationService::current()->Notify( |
2136 NotificationType::FRAME_PROVISIONAL_LOAD_START, | 2136 NotificationType::FRAME_PROVISIONAL_LOAD_START, |
2137 Source<NavigationController>(&controller_), | 2137 Source<NavigationController>(&controller_), |
2138 Details<ProvisionalLoadDetails>(&details)); | 2138 Details<ProvisionalLoadDetails>(&details)); |
2139 if (is_main_frame) { | 2139 if (is_main_frame) { |
2140 content_settings_delegate_->ClearCookieSpecificContentSettings(); | 2140 // If the URL is invalid, we're displaying a network error page. Not |
2141 // resetting the content settings delegate's cookies in that case so the | |
2142 // user has a chance to modify cookie settings. | |
2143 if (url.is_valid()) | |
darin (slow to review)
2010/11/24 17:14:07
it seems like we should have a more direct signal
| |
2144 content_settings_delegate_->ClearCookieSpecificContentSettings(); | |
2141 content_settings_delegate_->ClearGeolocationContentSettings(); | 2145 content_settings_delegate_->ClearGeolocationContentSettings(); |
2142 } | 2146 } |
2143 } | 2147 } |
2144 | 2148 |
2145 void TabContents::DidStartReceivingResourceResponse( | 2149 void TabContents::DidStartReceivingResourceResponse( |
2146 const ResourceRequestDetails& details) { | 2150 const ResourceRequestDetails& details) { |
2147 NotificationService::current()->Notify( | 2151 NotificationService::current()->Notify( |
2148 NotificationType::RESOURCE_RESPONSE_STARTED, | 2152 NotificationType::RESOURCE_RESPONSE_STARTED, |
2149 Source<NavigationController>(&controller()), | 2153 Source<NavigationController>(&controller()), |
2150 Details<const ResourceRequestDetails>(&details)); | 2154 Details<const ResourceRequestDetails>(&details)); |
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3217 } | 3221 } |
3218 | 3222 |
3219 void TabContents::set_encoding(const std::string& encoding) { | 3223 void TabContents::set_encoding(const std::string& encoding) { |
3220 encoding_ = CharacterEncoding::GetCanonicalEncodingNameByAliasName(encoding); | 3224 encoding_ = CharacterEncoding::GetCanonicalEncodingNameByAliasName(encoding); |
3221 } | 3225 } |
3222 | 3226 |
3223 void TabContents::SetAppIcon(const SkBitmap& app_icon) { | 3227 void TabContents::SetAppIcon(const SkBitmap& app_icon) { |
3224 app_icon_ = app_icon; | 3228 app_icon_ = app_icon; |
3225 NotifyNavigationStateChanged(INVALIDATE_TITLE); | 3229 NotifyNavigationStateChanged(INVALIDATE_TITLE); |
3226 } | 3230 } |
OLD | NEW |