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 2108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2119 delegate()->OnSetSuggestions(page_id, suggestions); | 2119 delegate()->OnSetSuggestions(page_id, suggestions); |
2120 } | 2120 } |
2121 | 2121 |
2122 void TabContents::OnInstantSupportDetermined(int32 page_id, bool result) { | 2122 void TabContents::OnInstantSupportDetermined(int32 page_id, bool result) { |
2123 if (delegate()) | 2123 if (delegate()) |
2124 delegate()->OnInstantSupportDetermined(page_id, result); | 2124 delegate()->OnInstantSupportDetermined(page_id, result); |
2125 } | 2125 } |
2126 | 2126 |
2127 void TabContents::DidStartProvisionalLoadForFrame( | 2127 void TabContents::DidStartProvisionalLoadForFrame( |
2128 RenderViewHost* render_view_host, | 2128 RenderViewHost* render_view_host, |
2129 long long frame_id, | 2129 int64 frame_id, |
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) { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2183 displayed_insecure_content_ = true; | 2183 displayed_insecure_content_ = true; |
2184 SSLManager::NotifySSLInternalStateChanged(); | 2184 SSLManager::NotifySSLInternalStateChanged(); |
2185 } | 2185 } |
2186 | 2186 |
2187 void TabContents::DidRunInsecureContent(const std::string& security_origin) { | 2187 void TabContents::DidRunInsecureContent(const std::string& security_origin) { |
2188 controller_.ssl_manager()->DidRunInsecureContent(security_origin); | 2188 controller_.ssl_manager()->DidRunInsecureContent(security_origin); |
2189 } | 2189 } |
2190 | 2190 |
2191 void TabContents::DidFailProvisionalLoadWithError( | 2191 void TabContents::DidFailProvisionalLoadWithError( |
2192 RenderViewHost* render_view_host, | 2192 RenderViewHost* render_view_host, |
2193 long long frame_id, | 2193 int64 frame_id, |
2194 bool is_main_frame, | 2194 bool is_main_frame, |
2195 int error_code, | 2195 int error_code, |
2196 const GURL& url, | 2196 const GURL& url, |
2197 bool showing_repost_interstitial) { | 2197 bool showing_repost_interstitial) { |
2198 if (net::ERR_ABORTED == error_code) { | 2198 if (net::ERR_ABORTED == error_code) { |
2199 // EVIL HACK ALERT! Ignore failed loads when we're showing interstitials. | 2199 // EVIL HACK ALERT! Ignore failed loads when we're showing interstitials. |
2200 // This means that the interstitial won't be torn down properly, which is | 2200 // This means that the interstitial won't be torn down properly, which is |
2201 // bad. But if we have an interstitial, go back to another tab type, and | 2201 // bad. But if we have an interstitial, go back to another tab type, and |
2202 // then load the same interstitial again, we could end up getting the first | 2202 // then load the same interstitial again, we could end up getting the first |
2203 // interstitial's "failed" message (as a result of the cancel) when we're on | 2203 // interstitial's "failed" message (as a result of the cancel) when we're on |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2238 controller_.IsURLInPageNavigation(url), | 2238 controller_.IsURLInPageNavigation(url), |
2239 url, std::string(), false, frame_id); | 2239 url, std::string(), false, frame_id); |
2240 details.set_error_code(error_code); | 2240 details.set_error_code(error_code); |
2241 | 2241 |
2242 NotificationService::current()->Notify( | 2242 NotificationService::current()->Notify( |
2243 NotificationType::FAIL_PROVISIONAL_LOAD_WITH_ERROR, | 2243 NotificationType::FAIL_PROVISIONAL_LOAD_WITH_ERROR, |
2244 Source<NavigationController>(&controller_), | 2244 Source<NavigationController>(&controller_), |
2245 Details<ProvisionalLoadDetails>(&details)); | 2245 Details<ProvisionalLoadDetails>(&details)); |
2246 } | 2246 } |
2247 | 2247 |
2248 void TabContents::DocumentLoadedInFrame(long long frame_id) { | 2248 void TabContents::DocumentLoadedInFrame(int64 frame_id) { |
2249 controller_.DocumentLoadedInFrame(); | 2249 controller_.DocumentLoadedInFrame(); |
2250 NotificationService::current()->Notify( | 2250 NotificationService::current()->Notify( |
2251 NotificationType::FRAME_DOM_CONTENT_LOADED, | 2251 NotificationType::FRAME_DOM_CONTENT_LOADED, |
2252 Source<NavigationController>(&controller_), | 2252 Source<NavigationController>(&controller_), |
2253 Details<long long>(&frame_id)); | 2253 Details<int64>(&frame_id)); |
2254 } | 2254 } |
2255 | 2255 |
2256 void TabContents::DidFinishLoad(long long frame_id) { | 2256 void TabContents::DidFinishLoad(int64 frame_id) { |
2257 NotificationService::current()->Notify( | 2257 NotificationService::current()->Notify( |
2258 NotificationType::FRAME_DID_FINISH_LOAD, | 2258 NotificationType::FRAME_DID_FINISH_LOAD, |
2259 Source<NavigationController>(&controller_), | 2259 Source<NavigationController>(&controller_), |
2260 Details<long long>(&frame_id)); | 2260 Details<int64>(&frame_id)); |
2261 } | 2261 } |
2262 | 2262 |
2263 void TabContents::OnContentSettingsAccessed(bool content_was_blocked) { | 2263 void TabContents::OnContentSettingsAccessed(bool content_was_blocked) { |
2264 if (delegate_) | 2264 if (delegate_) |
2265 delegate_->OnContentSettingsChange(this); | 2265 delegate_->OnContentSettingsChange(this); |
2266 } | 2266 } |
2267 | 2267 |
2268 RenderViewHostDelegate::View* TabContents::GetViewDelegate() { | 2268 RenderViewHostDelegate::View* TabContents::GetViewDelegate() { |
2269 return view_.get(); | 2269 return view_.get(); |
2270 } | 2270 } |
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3217 } | 3217 } |
3218 | 3218 |
3219 void TabContents::set_encoding(const std::string& encoding) { | 3219 void TabContents::set_encoding(const std::string& encoding) { |
3220 encoding_ = CharacterEncoding::GetCanonicalEncodingNameByAliasName(encoding); | 3220 encoding_ = CharacterEncoding::GetCanonicalEncodingNameByAliasName(encoding); |
3221 } | 3221 } |
3222 | 3222 |
3223 void TabContents::SetAppIcon(const SkBitmap& app_icon) { | 3223 void TabContents::SetAppIcon(const SkBitmap& app_icon) { |
3224 app_icon_ = app_icon; | 3224 app_icon_ = app_icon; |
3225 NotifyNavigationStateChanged(INVALIDATE_TITLE); | 3225 NotifyNavigationStateChanged(INVALIDATE_TITLE); |
3226 } | 3226 } |
OLD | NEW |