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

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: Addressed review comments 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 18 matching lines...) Expand all
29 AddLocalizedString("title", IDS_PRINT_PREVIEW_TITLE); 29 AddLocalizedString("title", IDS_PRINT_PREVIEW_TITLE);
30 AddLocalizedString("loading", IDS_PRINT_PREVIEW_LOADING); 30 AddLocalizedString("loading", IDS_PRINT_PREVIEW_LOADING);
31 #if defined(GOOGLE_CHROME_BUILD) 31 #if defined(GOOGLE_CHROME_BUILD)
32 AddString("noPlugin", l10n_util::GetStringFUTF16( 32 AddString("noPlugin", l10n_util::GetStringFUTF16(
33 IDS_PRINT_PREVIEW_NO_PLUGIN, ASCIIToUTF16("chrome://plugins/"))); 33 IDS_PRINT_PREVIEW_NO_PLUGIN, ASCIIToUTF16("chrome://plugins/")));
34 #else 34 #else
35 AddLocalizedString("noPlugin", IDS_PRINT_PREVIEW_NO_PLUGIN); 35 AddLocalizedString("noPlugin", IDS_PRINT_PREVIEW_NO_PLUGIN);
36 #endif 36 #endif
37 AddLocalizedString("launchNativeDialog", IDS_PRINT_PREVIEW_NATIVE_DIALOG); 37 AddLocalizedString("launchNativeDialog", IDS_PRINT_PREVIEW_NATIVE_DIALOG);
38 AddLocalizedString("previewFailed", IDS_PRINT_PREVIEW_FAILED); 38 AddLocalizedString("previewFailed", IDS_PRINT_PREVIEW_FAILED);
39 AddLocalizedString("initiatorTabCrashed",
40 IDS_PRINT_PREVIEW_INITIATOR_TAB_CRASHED);
39 AddLocalizedString("initiatorTabClosed", 41 AddLocalizedString("initiatorTabClosed",
40 IDS_PRINT_PREVIEW_INITIATOR_TAB_CLOSED); 42 IDS_PRINT_PREVIEW_INITIATOR_TAB_CLOSED);
41 AddLocalizedString("reopenPage", IDS_PRINT_PREVIEW_REOPEN_PAGE); 43 AddLocalizedString("reopenPage", IDS_PRINT_PREVIEW_REOPEN_PAGE);
42 44
43 AddLocalizedString("printButton", IDS_PRINT_PREVIEW_PRINT_BUTTON); 45 AddLocalizedString("printButton", IDS_PRINT_PREVIEW_PRINT_BUTTON);
44 AddLocalizedString("cancelButton", IDS_PRINT_PREVIEW_CANCEL_BUTTON); 46 AddLocalizedString("cancelButton", IDS_PRINT_PREVIEW_CANCEL_BUTTON);
45 AddLocalizedString("printing", IDS_PRINT_PREVIEW_PRINTING); 47 AddLocalizedString("printing", IDS_PRINT_PREVIEW_PRINTING);
46 48
47 AddLocalizedString("destinationLabel", IDS_PRINT_PREVIEW_DESTINATION_LABEL); 49 AddLocalizedString("destinationLabel", IDS_PRINT_PREVIEW_DESTINATION_LABEL);
48 AddLocalizedString("copiesLabel", IDS_PRINT_PREVIEW_COPIES_LABEL); 50 AddLocalizedString("copiesLabel", IDS_PRINT_PREVIEW_COPIES_LABEL);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 url_substr[0], page_index, &data); 123 url_substr[0], page_index, &data);
122 } 124 }
123 if (data.get()) { 125 if (data.get()) {
124 SendResponse(request_id, data); 126 SendResponse(request_id, data);
125 return; 127 return;
126 } 128 }
127 // Invalid request. 129 // Invalid request.
128 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes); 130 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes);
129 SendResponse(request_id, empty_bytes); 131 SendResponse(request_id, empty_bytes);
130 } 132 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698