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

Side by Side Diff: chrome/browser/ui/webui/extensions/chromeos/kiosk_apps_handler.cc

Issue 1172183002: Move StartsWith[ASCII] to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util3
Patch Set: merger Created 5 years, 6 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/extensions/chromeos/kiosk_apps_handler.h" 5 #include "chrome/browser/ui/webui/extensions/chromeos/kiosk_apps_handler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 GURL webstore_url = GURL(input); 69 GURL webstore_url = GURL(input);
70 if (!webstore_url.is_valid()) 70 if (!webstore_url.is_valid())
71 return false; 71 return false;
72 72
73 GURL webstore_base_url = 73 GURL webstore_base_url =
74 GURL(extension_urls::GetWebstoreItemDetailURLPrefix()); 74 GURL(extension_urls::GetWebstoreItemDetailURLPrefix());
75 75
76 if (webstore_url.scheme() != webstore_base_url.scheme() || 76 if (webstore_url.scheme() != webstore_base_url.scheme() ||
77 webstore_url.host() != webstore_base_url.host() || 77 webstore_url.host() != webstore_base_url.host() ||
78 !StartsWithASCII( 78 !base::StartsWithASCII(webstore_url.path(), webstore_base_url.path(),
79 webstore_url.path(), webstore_base_url.path(), true)) { 79 true)) {
80 return false; 80 return false;
81 } 81 }
82 82
83 const std::string path = webstore_url.path(); 83 const std::string path = webstore_url.path();
84 const size_t last_slash = path.rfind('/'); 84 const size_t last_slash = path.rfind('/');
85 if (last_slash == std::string::npos) 85 if (last_slash == std::string::npos)
86 return false; 86 return false;
87 87
88 const std::string candidate_id = path.substr(last_slash + 1); 88 const std::string candidate_id = path.substr(last_slash + 1);
89 if (!crx_file::id_util::IdIsValid(candidate_id)) 89 if (!crx_file::id_util::IdIsValid(candidate_id))
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 349
350 void KioskAppsHandler::ShowError(const std::string& app_id) { 350 void KioskAppsHandler::ShowError(const std::string& app_id) {
351 base::StringValue app_id_value(app_id); 351 base::StringValue app_id_value(app_id);
352 web_ui()->CallJavascriptFunction("extensions.KioskAppsOverlay.showError", 352 web_ui()->CallJavascriptFunction("extensions.KioskAppsOverlay.showError",
353 app_id_value); 353 app_id_value);
354 354
355 kiosk_app_manager_->RemoveApp(app_id, owner_settings_service_); 355 kiosk_app_manager_->RemoveApp(app_id, owner_settings_service_);
356 } 356 }
357 357
358 } // namespace chromeos 358 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/devtools_ui.cc ('k') | chrome/browser/ui/webui/interstitials/interstitial_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698