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

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

Issue 1280473002: Update ToLower/UpperASCII API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 } 253 }
254 254
255 scoped_ptr<ViewerHandle> CreateViewRequest( 255 scoped_ptr<ViewerHandle> CreateViewRequest(
256 DomDistillerServiceInterface* dom_distiller_service, 256 DomDistillerServiceInterface* dom_distiller_service,
257 const std::string& path, 257 const std::string& path,
258 ViewRequestDelegate* view_request_delegate, 258 ViewRequestDelegate* view_request_delegate,
259 const gfx::Size& render_view_size) { 259 const gfx::Size& render_view_size) {
260 std::string entry_id = 260 std::string entry_id =
261 url_utils::GetValueForKeyInUrlPathQuery(path, kEntryIdKey); 261 url_utils::GetValueForKeyInUrlPathQuery(path, kEntryIdKey);
262 bool has_valid_entry_id = !entry_id.empty(); 262 bool has_valid_entry_id = !entry_id.empty();
263 entry_id = base::StringToUpperASCII(entry_id); 263 entry_id = base::ToUpperASCII(entry_id);
264 264
265 std::string requested_url_str = 265 std::string requested_url_str =
266 url_utils::GetValueForKeyInUrlPathQuery(path, kUrlKey); 266 url_utils::GetValueForKeyInUrlPathQuery(path, kUrlKey);
267 GURL requested_url(requested_url_str); 267 GURL requested_url(requested_url_str);
268 bool has_valid_url = url_utils::IsUrlDistillable(requested_url); 268 bool has_valid_url = url_utils::IsUrlDistillable(requested_url);
269 269
270 if (has_valid_entry_id && has_valid_url) { 270 if (has_valid_entry_id && has_valid_url) {
271 // It is invalid to specify a query param for both |kEntryIdKey| and 271 // It is invalid to specify a query param for both |kEntryIdKey| and
272 // |kUrlKey|. 272 // |kUrlKey|.
273 return scoped_ptr<ViewerHandle>(); 273 return scoped_ptr<ViewerHandle>();
(...skipping 20 matching lines...) Expand all
294 } 294 }
295 295
296 const std::string GetDistilledPageFontFamilyJs( 296 const std::string GetDistilledPageFontFamilyJs(
297 DistilledPagePrefs::FontFamily font_family) { 297 DistilledPagePrefs::FontFamily font_family) {
298 return "useFontFamily('" + GetJsFontFamily(font_family) + "');"; 298 return "useFontFamily('" + GetJsFontFamily(font_family) + "');";
299 } 299 }
300 300
301 } // namespace viewer 301 } // namespace viewer
302 302
303 } // namespace dom_distiller 303 } // namespace dom_distiller
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698