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

Side by Side Diff: chrome/browser/web_applications/web_app.cc

Issue 7811006: Add full support for filesystem URLs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed code review feedback. Created 8 years, 10 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/web_applications/web_app.h" 5 #include "chrome/browser/web_applications/web_app.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/i18n/file_util_icu.h" 9 #include "base/i18n/file_util_icu.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 web_app::internals::GetWebAppDataDirectory( 128 web_app::internals::GetWebAppDataDirectory(
129 web_app::GetDataDir(data_dir), 129 web_app::GetDataDir(data_dir),
130 shortcut_info), 130 shortcut_info),
131 data_dir, 131 data_dir,
132 shortcut_info)); 132 shortcut_info));
133 } 133 }
134 134
135 bool IsValidUrl(const GURL& url) { 135 bool IsValidUrl(const GURL& url) {
136 static const char* const kValidUrlSchemes[] = { 136 static const char* const kValidUrlSchemes[] = {
137 chrome::kFileScheme, 137 chrome::kFileScheme,
138 chrome::kFileSystemScheme,
138 chrome::kFtpScheme, 139 chrome::kFtpScheme,
139 chrome::kHttpScheme, 140 chrome::kHttpScheme,
140 chrome::kHttpsScheme, 141 chrome::kHttpsScheme,
141 chrome::kExtensionScheme, 142 chrome::kExtensionScheme,
142 }; 143 };
143 144
144 for (size_t i = 0; i < arraysize(kValidUrlSchemes); ++i) { 145 for (size_t i = 0; i < arraysize(kValidUrlSchemes); ++i) {
145 if (url.SchemeIs(kValidUrlSchemes[i])) 146 if (url.SchemeIs(kValidUrlSchemes[i]))
146 return true; 147 return true;
147 } 148 }
(...skipping 24 matching lines...) Expand all
172 173
173 #if defined(TOOLKIT_USES_GTK) 174 #if defined(TOOLKIT_USES_GTK)
174 std::string GetWMClassFromAppName(std::string app_name) { 175 std::string GetWMClassFromAppName(std::string app_name) {
175 file_util::ReplaceIllegalCharactersInPath(&app_name, '_'); 176 file_util::ReplaceIllegalCharactersInPath(&app_name, '_');
176 TrimString(app_name, "_", &app_name); 177 TrimString(app_name, "_", &app_name);
177 return app_name; 178 return app_name;
178 } 179 }
179 #endif 180 #endif
180 181
181 } // namespace web_app 182 } // namespace web_app
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698