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

Side by Side Diff: chrome/browser/extensions/api/developer_private/developer_private_api.cc

Issue 16392011: Move FileEnumerator to its own file, do some refactoring. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix incorrect includes Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/extensions/api/developer_private/developer_private_api. h" 5 #include "chrome/browser/extensions/api/developer_private/developer_private_api. h"
6 6
7 #include "apps/app_load_service.h" 7 #include "apps/app_load_service.h"
8 #include "base/base64.h" 8 #include "base/base64.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
11 #include "base/files/file_enumerator.h"
11 #include "base/i18n/file_util_icu.h" 12 #include "base/i18n/file_util_icu.h"
12 #include "base/strings/string_number_conversions.h" 13 #include "base/strings/string_number_conversions.h"
13 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
14 #include "base/values.h" 15 #include "base/values.h"
15 #include "chrome/browser/devtools/devtools_window.h" 16 #include "chrome/browser/devtools/devtools_window.h"
16 #include "chrome/browser/extensions/api/developer_private/developer_private_api_ factory.h" 17 #include "chrome/browser/extensions/api/developer_private/developer_private_api_ factory.h"
17 #include "chrome/browser/extensions/api/developer_private/entry_picker.h" 18 #include "chrome/browser/extensions/api/developer_private/entry_picker.h"
18 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" 19 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h"
19 #include "chrome/browser/extensions/extension_disabled_ui.h" 20 #include "chrome/browser/extensions/extension_disabled_ui.h"
20 #include "chrome/browser/extensions/extension_error_reporter.h" 21 #include "chrome/browser/extensions/extension_error_reporter.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 79
79 std::string contents_base64; 80 std::string contents_base64;
80 if (!base::Base64Encode(contents, &contents_base64)) 81 if (!base::Base64Encode(contents, &contents_base64))
81 return GURL(); 82 return GURL();
82 83
83 const char kDataURLPrefix[] = "data:image;base64,"; 84 const char kDataURLPrefix[] = "data:image;base64,";
84 return GURL(kDataURLPrefix + contents_base64); 85 return GURL(kDataURLPrefix + contents_base64);
85 } 86 }
86 87
87 std::vector<base::FilePath> ListFolder(const base::FilePath path) { 88 std::vector<base::FilePath> ListFolder(const base::FilePath path) {
88 file_util::FileEnumerator files(path, false, 89 base::FileEnumerator files(path, false,
89 file_util::FileEnumerator::DIRECTORIES 90 base::FileEnumerator::DIRECTORIES | base::FileEnumerator::FILES);
90 | file_util::FileEnumerator::FILES);
91 std::vector<base::FilePath> paths; 91 std::vector<base::FilePath> paths;
92 92
93 for (base::FilePath current_path = files.Next(); !current_path.empty(); 93 for (base::FilePath current_path = files.Next(); !current_path.empty();
94 current_path = files.Next()) { 94 current_path = files.Next()) {
95 paths.push_back(current_path); 95 paths.push_back(current_path);
96 } 96 }
97 return paths; 97 return paths;
98 } 98 }
99 99
100 bool ValidateFolderName(const base::FilePath::StringType& name) { 100 bool ValidateFolderName(const base::FilePath::StringType& name) {
(...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after
1173 1173
1174 #undef SET_STRING 1174 #undef SET_STRING
1175 return true; 1175 return true;
1176 } 1176 }
1177 1177
1178 DeveloperPrivateGetStringsFunction::~DeveloperPrivateGetStringsFunction() {} 1178 DeveloperPrivateGetStringsFunction::~DeveloperPrivateGetStringsFunction() {}
1179 1179
1180 } // namespace api 1180 } // namespace api
1181 1181
1182 } // namespace extensions 1182 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698