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

Side by Side Diff: components/dom_distiller/core/viewer.cc

Issue 444143002: Loading Indicator for Distilled Pages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added closure Created 6 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 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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698