| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/file_version_info.h" | 9 #include "base/file_version_info.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 2186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2197 PrefService* prefs = render_view_host()->process()->profile()->GetPrefs(); | 2197 PrefService* prefs = render_view_host()->process()->profile()->GetPrefs(); |
| 2198 bool isDomUI = false; | 2198 bool isDomUI = false; |
| 2199 return RenderViewHostDelegateHelper::GetWebkitPrefs(prefs, isDomUI); | 2199 return RenderViewHostDelegateHelper::GetWebkitPrefs(prefs, isDomUI); |
| 2200 } | 2200 } |
| 2201 | 2201 |
| 2202 void TabContents::OnJSOutOfMemory() { | 2202 void TabContents::OnJSOutOfMemory() { |
| 2203 AddInfoBar(new SimpleAlertInfoBarDelegate( | 2203 AddInfoBar(new SimpleAlertInfoBarDelegate( |
| 2204 this, l10n_util::GetString(IDS_JS_OUT_OF_MEMORY_PROMPT), NULL)); | 2204 this, l10n_util::GetString(IDS_JS_OUT_OF_MEMORY_PROMPT), NULL)); |
| 2205 } | 2205 } |
| 2206 | 2206 |
| 2207 void TabContents::ShouldClosePage(bool proceed) { | |
| 2208 render_manager_.ShouldClosePage(proceed); | |
| 2209 } | |
| 2210 | |
| 2211 void TabContents::OnCrossSiteResponse(int new_render_process_host_id, | 2207 void TabContents::OnCrossSiteResponse(int new_render_process_host_id, |
| 2212 int new_request_id) { | 2208 int new_request_id) { |
| 2213 // Allows the TabContents to react when a cross-site response is ready to be | 2209 // Allows the TabContents to react when a cross-site response is ready to be |
| 2214 // delivered to a pending RenderViewHost. We must first run the onunload | 2210 // delivered to a pending RenderViewHost. We must first run the onunload |
| 2215 // handler of the old RenderViewHost before we can allow it to proceed. | 2211 // handler of the old RenderViewHost before we can allow it to proceed. |
| 2216 render_manager_.OnCrossSiteResponse(new_render_process_host_id, | 2212 render_manager_.OnCrossSiteResponse(new_render_process_host_id, |
| 2217 new_request_id); | 2213 new_request_id); |
| 2218 } | 2214 } |
| 2219 | 2215 |
| 2220 bool TabContents::CanBlur() const { | 2216 bool TabContents::CanBlur() const { |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2375 NavigationController::LoadCommittedDetails& committed_details = | 2371 NavigationController::LoadCommittedDetails& committed_details = |
| 2376 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); | 2372 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); |
| 2377 ExpireInfoBars(committed_details); | 2373 ExpireInfoBars(committed_details); |
| 2378 break; | 2374 break; |
| 2379 } | 2375 } |
| 2380 | 2376 |
| 2381 default: | 2377 default: |
| 2382 NOTREACHED(); | 2378 NOTREACHED(); |
| 2383 } | 2379 } |
| 2384 } | 2380 } |
| OLD | NEW |