| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/dom_distiller/core/viewer.h" | 5 #include "components/dom_distiller/core/viewer.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 base::StringPiece html_template = | 68 base::StringPiece html_template = |
| 69 ResourceBundle::GetSharedInstance().GetRawDataResource( | 69 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 70 IDR_DOM_DISTILLER_VIEWER_HTML); | 70 IDR_DOM_DISTILLER_VIEWER_HTML); |
| 71 std::vector<std::string> substitutions; | 71 std::vector<std::string> substitutions; |
| 72 substitutions.push_back(title); // $1 | 72 substitutions.push_back(title); // $1 |
| 73 substitutions.push_back(kViewerCssPath); // $2 | 73 substitutions.push_back(kViewerCssPath); // $2 |
| 74 substitutions.push_back(kViewerJsPath); // $3 | 74 substitutions.push_back(kViewerJsPath); // $3 |
| 75 substitutions.push_back(GetCssClass(theme)); // $4 | 75 substitutions.push_back(GetCssClass(theme)); // $4 |
| 76 substitutions.push_back(content); // $5 | 76 substitutions.push_back(content); // $5 |
| 77 substitutions.push_back(loading_indicator_class); // $6 | 77 substitutions.push_back(loading_indicator_class); // $6 |
| 78 substitutions.push_back(original_url); // $7 |
| 78 substitutions.push_back( | 79 substitutions.push_back( |
| 79 l10n_util::GetStringUTF8(IDS_DOM_DISTILLER_VIEWER_LOADING_STRING)); // $7 | 80 l10n_util::GetStringUTF8(IDS_DOM_DISTILLER_VIEWER_VIEW_ORIGINAL)); // $8 |
| 80 substitutions.push_back(original_url); // $8 | |
| 81 substitutions.push_back( | |
| 82 l10n_util::GetStringUTF8(IDS_DOM_DISTILLER_VIEWER_VIEW_ORIGINAL)); // $9 | |
| 83 return ReplaceStringPlaceholders(html_template, substitutions, NULL); | 81 return ReplaceStringPlaceholders(html_template, substitutions, NULL); |
| 84 } | 82 } |
| 85 | 83 |
| 86 } // namespace | 84 } // namespace |
| 87 | 85 |
| 88 namespace viewer { | 86 namespace viewer { |
| 89 | 87 |
| 90 const std::string GetUnsafeIncrementalDistilledPageJs( | 88 const std::string GetUnsafeIncrementalDistilledPageJs( |
| 91 const DistilledPageProto* page_proto, | 89 const DistilledPageProto* page_proto, |
| 92 const bool is_last_page) { | 90 const bool is_last_page) { |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 return scoped_ptr<ViewerHandle>(); | 209 return scoped_ptr<ViewerHandle>(); |
| 212 } | 210 } |
| 213 | 211 |
| 214 const std::string GetDistilledPageThemeJs(DistilledPagePrefs::Theme theme) { | 212 const std::string GetDistilledPageThemeJs(DistilledPagePrefs::Theme theme) { |
| 215 return "useTheme('" + GetJsTheme(theme) + "');"; | 213 return "useTheme('" + GetJsTheme(theme) + "');"; |
| 216 } | 214 } |
| 217 | 215 |
| 218 } // namespace viewer | 216 } // namespace viewer |
| 219 | 217 |
| 220 } // namespace dom_distiller | 218 } // namespace dom_distiller |
| OLD | NEW |