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

Side by Side Diff: extensions/browser/content_verifier.cc

Issue 1223153003: Move JoinString to the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: windows Created 5 years, 5 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 "extensions/browser/content_verifier.h" 5 #include "extensions/browser/content_verifier.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 // Remove the first component if it is '.' or '/' or '//'. 117 // Remove the first component if it is '.' or '/' or '//'.
118 const base::FilePath::StringType separators( 118 const base::FilePath::StringType separators(
119 base::FilePath::kSeparators, base::FilePath::kSeparatorsLength); 119 base::FilePath::kSeparators, base::FilePath::kSeparatorsLength);
120 if (!parts[0].empty() && 120 if (!parts[0].empty() &&
121 (parts[0] == base::FilePath::kCurrentDirectory || 121 (parts[0] == base::FilePath::kCurrentDirectory ||
122 parts[0].find_first_not_of(separators) == std::string::npos)) 122 parts[0].find_first_not_of(separators) == std::string::npos))
123 parts.erase(parts.begin()); 123 parts.erase(parts.begin());
124 124
125 // Note that elsewhere we always normalize path separators to '/' so this 125 // Note that elsewhere we always normalize path separators to '/' so this
126 // should work for all platforms. 126 // should work for all platforms.
127 return base::FilePath(JoinString(parts, '/')); 127 return base::FilePath(
128 base::JoinString(parts, base::FilePath::StringType(1, '/')));
128 } 129 }
129 130
130 void ContentVerifier::OnExtensionLoaded( 131 void ContentVerifier::OnExtensionLoaded(
131 content::BrowserContext* browser_context, 132 content::BrowserContext* browser_context,
132 const Extension* extension) { 133 const Extension* extension) {
133 if (shutdown_) 134 if (shutdown_)
134 return; 135 return;
135 136
136 ContentVerifierDelegate::Mode mode = delegate_->ShouldBeVerified(*extension); 137 ContentVerifierDelegate::Mode mode = delegate_->ShouldBeVerified(*extension);
137 if (mode != ContentVerifierDelegate::NONE) { 138 if (mode != ContentVerifierDelegate::NONE) {
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 !extension_l10n_util::ShouldSkipValidation( 262 !extension_l10n_util::ShouldSkipValidation(
262 locales_dir, full_path.DirName(), *all_locales)) 263 locales_dir, full_path.DirName(), *all_locales))
263 continue; 264 continue;
264 } 265 }
265 return true; 266 return true;
266 } 267 }
267 return false; 268 return false;
268 } 269 }
269 270
270 } // namespace extensions 271 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/vpn_provider/vpn_provider_api.cc ('k') | extensions/browser/updater/extension_downloader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698