| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 // If another javascript message box is displayed within | 116 // If another javascript message box is displayed within |
| 117 // kJavascriptMessageExpectedDelay of a previous javascript message box being | 117 // kJavascriptMessageExpectedDelay of a previous javascript message box being |
| 118 // dismissed, display an option to suppress future message boxes from this | 118 // dismissed, display an option to suppress future message boxes from this |
| 119 // contents. | 119 // contents. |
| 120 const int kJavascriptMessageExpectedDelay = 1000; | 120 const int kJavascriptMessageExpectedDelay = 1000; |
| 121 | 121 |
| 122 const char kLinkDoctorBaseURL[] = | 122 const char kLinkDoctorBaseURL[] = |
| 123 "http://linkhelp.clients.google.com/tbproxy/lh/fixurl"; | 123 "http://linkhelp.clients.google.com/tbproxy/lh/fixurl"; |
| 124 | 124 |
| 125 // The printer icon in shell32.dll. That's a standard icon user will quickly | |
| 126 // recognize. | |
| 127 const int kShell32PrinterIcon = 17; | |
| 128 | |
| 129 // The list of prefs we want to observe. | 125 // The list of prefs we want to observe. |
| 130 const wchar_t* kPrefsToObserve[] = { | 126 const wchar_t* kPrefsToObserve[] = { |
| 131 prefs::kAlternateErrorPagesEnabled, | 127 prefs::kAlternateErrorPagesEnabled, |
| 132 prefs::kWebKitJavaEnabled, | 128 prefs::kWebKitJavaEnabled, |
| 133 prefs::kWebKitJavascriptEnabled, | 129 prefs::kWebKitJavascriptEnabled, |
| 134 prefs::kWebKitLoadsImagesAutomatically, | 130 prefs::kWebKitLoadsImagesAutomatically, |
| 135 prefs::kWebKitPluginsEnabled, | 131 prefs::kWebKitPluginsEnabled, |
| 136 prefs::kWebKitUsesUniversalDetector, | 132 prefs::kWebKitUsesUniversalDetector, |
| 137 prefs::kWebKitSerifFontFamily, | 133 prefs::kWebKitSerifFontFamily, |
| 138 prefs::kWebKitSansSerifFontFamily, | 134 prefs::kWebKitSansSerifFontFamily, |
| (...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1026 } | 1022 } |
| 1027 | 1023 |
| 1028 bool TabContents::PrintNow() { | 1024 bool TabContents::PrintNow() { |
| 1029 // We can't print interstitial page for now. | 1025 // We can't print interstitial page for now. |
| 1030 if (showing_interstitial_page()) | 1026 if (showing_interstitial_page()) |
| 1031 return false; | 1027 return false; |
| 1032 | 1028 |
| 1033 return render_view_host()->PrintPages(); | 1029 return render_view_host()->PrintPages(); |
| 1034 } | 1030 } |
| 1035 | 1031 |
| 1032 void TabContents::PrintingDone(int document_cookie, bool success) { |
| 1033 render_view_host()->PrintingDone(document_cookie, success); |
| 1034 } |
| 1035 |
| 1036 bool TabContents::IsActiveEntry(int32 page_id) { | 1036 bool TabContents::IsActiveEntry(int32 page_id) { |
| 1037 NavigationEntry* active_entry = controller_.GetActiveEntry(); | 1037 NavigationEntry* active_entry = controller_.GetActiveEntry(); |
| 1038 return (active_entry != NULL && | 1038 return (active_entry != NULL && |
| 1039 active_entry->site_instance() == GetSiteInstance() && | 1039 active_entry->site_instance() == GetSiteInstance() && |
| 1040 active_entry->page_id() == page_id); | 1040 active_entry->page_id() == page_id); |
| 1041 } | 1041 } |
| 1042 | 1042 |
| 1043 // Notifies the RenderWidgetHost instance about the fact that the page is | 1043 // Notifies the RenderWidgetHost instance about the fact that the page is |
| 1044 // loading, or done loading and calls the base implementation. | 1044 // loading, or done loading and calls the base implementation. |
| 1045 void TabContents::SetIsLoading(bool is_loading, | 1045 void TabContents::SetIsLoading(bool is_loading, |
| (...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2336 NavigationController::LoadCommittedDetails& committed_details = | 2336 NavigationController::LoadCommittedDetails& committed_details = |
| 2337 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); | 2337 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); |
| 2338 ExpireInfoBars(committed_details); | 2338 ExpireInfoBars(committed_details); |
| 2339 break; | 2339 break; |
| 2340 } | 2340 } |
| 2341 | 2341 |
| 2342 default: | 2342 default: |
| 2343 NOTREACHED(); | 2343 NOTREACHED(); |
| 2344 } | 2344 } |
| 2345 } | 2345 } |
| OLD | NEW |