Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: chrome/browser/ui/webui/print_preview_data_source.cc

Issue 7550063: Print Preview: Handle a crashed initiator tab by showing a message in PP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/ui/webui/print_preview_data_source.h" 5 #include "chrome/browser/ui/webui/print_preview_data_source.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 24 matching lines...) Expand all
35 l10n_util::GetStringFUTF8(IDS_PRINT_PREVIEW_NO_PLUGIN, 35 l10n_util::GetStringFUTF8(IDS_PRINT_PREVIEW_NO_PLUGIN,
36 ASCIIToUTF16("chrome://plugins/"))); 36 ASCIIToUTF16("chrome://plugins/")));
37 #else 37 #else
38 localized_strings->SetString(std::string("noPlugin"), 38 localized_strings->SetString(std::string("noPlugin"),
39 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_NO_PLUGIN)); 39 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_NO_PLUGIN));
40 #endif 40 #endif
41 localized_strings->SetString(std::string("launchNativeDialog"), 41 localized_strings->SetString(std::string("launchNativeDialog"),
42 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_NATIVE_DIALOG)); 42 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_NATIVE_DIALOG));
43 localized_strings->SetString(std::string("previewFailed"), 43 localized_strings->SetString(std::string("previewFailed"),
44 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_FAILED)); 44 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_FAILED));
45 localized_strings->SetString(std::string("initiatorTabCrashed"),
46 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_INITIATOR_TAB_CRASHED));
45 localized_strings->SetString(std::string("initiatorTabClosed"), 47 localized_strings->SetString(std::string("initiatorTabClosed"),
46 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_INITIATOR_TAB_CLOSED)); 48 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_INITIATOR_TAB_CLOSED));
47 localized_strings->SetString(std::string("reopenPage"), 49 localized_strings->SetString(std::string("reopenPage"),
48 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_REOPEN_PAGE)); 50 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_REOPEN_PAGE));
49 51
50 localized_strings->SetString(std::string("printButton"), 52 localized_strings->SetString(std::string("printButton"),
51 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PRINT_BUTTON)); 53 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PRINT_BUTTON));
52 localized_strings->SetString(std::string("cancelButton"), 54 localized_strings->SetString(std::string("cancelButton"),
53 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_CANCEL_BUTTON)); 55 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_CANCEL_BUTTON));
54 localized_strings->SetString(std::string("printing"), 56 localized_strings->SetString(std::string("printing"),
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // Invalid request. 180 // Invalid request.
179 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes); 181 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes);
180 SendResponse(request_id, empty_bytes); 182 SendResponse(request_id, empty_bytes);
181 return; 183 return;
182 } 184 }
183 } 185 }
184 186
185 std::string PrintPreviewDataSource::GetMimeType(const std::string& path) const { 187 std::string PrintPreviewDataSource::GetMimeType(const std::string& path) const {
186 return path.empty() ? "text/html" : "application/pdf"; 188 return path.empty() ? "text/html" : "application/pdf";
187 } 189 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698