| OLD | NEW |
| 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" |
| 11 #include "base/string_piece.h" | 11 #include "base/string_piece.h" |
| 12 #include "base/string_split.h" | 12 #include "base/string_split.h" |
| 13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "chrome/browser/printing/print_preview_data_service.h" | 16 #include "chrome/browser/printing/print_preview_data_service.h" |
| 17 #include "chrome/common/jstemplate_builder.h" | 17 #include "chrome/common/jstemplate_builder.h" |
| 18 #include "chrome/common/url_constants.h" | 18 #include "chrome/common/url_constants.h" |
| 19 #include "grit/browser_resources.h" | 19 #include "grit/browser_resources.h" |
| 20 #include "grit/chromium_strings.h" | 20 #include "grit/chromium_strings.h" |
| 21 #include "grit/generated_resources.h" | 21 #include "grit/generated_resources.h" |
| 22 #include "grit/google_chrome_strings.h" | 22 #include "grit/google_chrome_strings.h" |
| 23 #include "ui/base/l10n/l10n_util.h" | 23 #include "ui/base/l10n/l10n_util.h" |
| 24 #include "ui/base/resource/resource_bundle.h" | 24 #include "ui/base/resource/resource_bundle.h" |
| 25 | 25 |
| 26 namespace{ | 26 namespace{ |
| 27 | 27 |
| 28 #if defined(OS_MACOSX) | 28 #if defined(OS_MACOSX) |
| 29 // U+0028 U+21E7 U+2318 U+0050 U+0029 in UTF8 | 29 // U+0028 U+21E7 U+2318 U+0050 U+0029 in UTF8 |
| 30 const char kAdvancedPrintShortcut[] = "\x28\xE2\x8C\x98\xE2\x87\xA7\x50\x29"; | 30 const char kAdvancedPrintShortcut[] = "\x28\xE2\x8c\xA5\xE2\x8C\x98\x50\x29"; |
| 31 #elif defined(OS_WIN) | 31 #elif defined(OS_WIN) |
| 32 const char kAdvancedPrintShortcut[] = "(Ctrl+Shift+P)"; | 32 const char kAdvancedPrintShortcut[] = "(Ctrl+Shift+P)"; |
| 33 #else | 33 #else |
| 34 const char kAdvancedPrintShortcut[] = "(Shift+Ctrl+P)"; | 34 const char kAdvancedPrintShortcut[] = "(Shift+Ctrl+P)"; |
| 35 #endif | 35 #endif |
| 36 | 36 |
| 37 }; // namespace | 37 }; // namespace |
| 38 | 38 |
| 39 PrintPreviewDataSource::PrintPreviewDataSource() | 39 PrintPreviewDataSource::PrintPreviewDataSource() |
| 40 : ChromeWebUIDataSource(chrome::kChromeUIPrintHost) { | 40 : ChromeWebUIDataSource(chrome::kChromeUIPrintHost) { |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 url_substr[0], page_index, &data); | 146 url_substr[0], page_index, &data); |
| 147 } | 147 } |
| 148 if (data.get()) { | 148 if (data.get()) { |
| 149 SendResponse(request_id, data); | 149 SendResponse(request_id, data); |
| 150 return; | 150 return; |
| 151 } | 151 } |
| 152 // Invalid request. | 152 // Invalid request. |
| 153 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes); | 153 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes); |
| 154 SendResponse(request_id, empty_bytes); | 154 SendResponse(request_id, empty_bytes); |
| 155 } | 155 } |
| OLD | NEW |