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

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

Issue 474483002: Revert 289312 "Move StringToUpperASCII and LowerCaseEqualsASCII ..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 } 175 }
176 176
177 scoped_ptr<ViewerHandle> CreateViewRequest( 177 scoped_ptr<ViewerHandle> CreateViewRequest(
178 DomDistillerServiceInterface* dom_distiller_service, 178 DomDistillerServiceInterface* dom_distiller_service,
179 const std::string& path, 179 const std::string& path,
180 ViewRequestDelegate* view_request_delegate, 180 ViewRequestDelegate* view_request_delegate,
181 const gfx::Size& render_view_size) { 181 const gfx::Size& render_view_size) {
182 std::string entry_id = 182 std::string entry_id =
183 url_utils::GetValueForKeyInUrlPathQuery(path, kEntryIdKey); 183 url_utils::GetValueForKeyInUrlPathQuery(path, kEntryIdKey);
184 bool has_valid_entry_id = !entry_id.empty(); 184 bool has_valid_entry_id = !entry_id.empty();
185 entry_id = base::StringToUpperASCII(entry_id); 185 entry_id = StringToUpperASCII(entry_id);
186 186
187 std::string requested_url_str = 187 std::string requested_url_str =
188 url_utils::GetValueForKeyInUrlPathQuery(path, kUrlKey); 188 url_utils::GetValueForKeyInUrlPathQuery(path, kUrlKey);
189 GURL requested_url(requested_url_str); 189 GURL requested_url(requested_url_str);
190 bool has_valid_url = url_utils::IsUrlDistillable(requested_url); 190 bool has_valid_url = url_utils::IsUrlDistillable(requested_url);
191 191
192 if (has_valid_entry_id && has_valid_url) { 192 if (has_valid_entry_id && has_valid_url) {
193 // It is invalid to specify a query param for both |kEntryIdKey| and 193 // It is invalid to specify a query param for both |kEntryIdKey| and
194 // |kUrlKey|. 194 // |kUrlKey|.
195 return scoped_ptr<ViewerHandle>(); 195 return scoped_ptr<ViewerHandle>();
(...skipping 15 matching lines...) Expand all
211 return scoped_ptr<ViewerHandle>(); 211 return scoped_ptr<ViewerHandle>();
212 } 212 }
213 213
214 const std::string GetDistilledPageThemeJs(DistilledPagePrefs::Theme theme) { 214 const std::string GetDistilledPageThemeJs(DistilledPagePrefs::Theme theme) {
215 return "useTheme('" + GetJsTheme(theme) + "');"; 215 return "useTheme('" + GetJsTheme(theme) + "');";
216 } 216 }
217 217
218 } // namespace viewer 218 } // namespace viewer
219 219
220 } // namespace dom_distiller 220 } // namespace dom_distiller
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698