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

Unified Diff: chrome/browser/extensions/file_manager_util.cc

Issue 8457004: platform_util::OpenItem fixes (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/file_manager_util.cc
===================================================================
--- chrome/browser/extensions/file_manager_util.cc (revision 108523)
+++ chrome/browser/extensions/file_manager_util.cc (working copy)
@@ -46,7 +46,10 @@
const char kMediaPlayerUrl[] = FILEBROWSER_URL("mediaplayer.html");
const char kMediaPlayerPlaylistUrl[] = FILEBROWSER_URL("playlist.html");
#undef FILEBROWSER_URL
+#undef FILEBROWSER_DOMAIN
+namespace {
+
const char kPdfExtension[] = ".pdf";
// List of file extension we can open in tab.
const char* kBrowserSupportedExtensions[] = {
@@ -117,11 +120,6 @@
return plugin_prefs->IsPluginEnabled(plugin);
}
-// static
-GURL FileManagerUtil::GetFileBrowserExtensionUrl() {
- return GURL(kFileBrowserExtensionUrl);
-}
-
// Returns index |ext| has in the |array|. If there is no |ext| in |array|, last
// element's index is return (last element should have irrelevant value).
int UMAExtensionIndex(const char *ext,
@@ -135,7 +133,14 @@
return 0;
}
+} // namespace
+
// static
+GURL FileManagerUtil::GetFileBrowserExtensionUrl() {
+ return GURL(kFileBrowserExtensionUrl);
+}
+
+// static
GURL FileManagerUtil::GetFileBrowserUrl() {
return GURL(kBaseFileBrowserUrl);
}
@@ -230,12 +235,10 @@
std::string url = FileManagerUtil::GetFileBrowserUrl().spec() +
'?' + EscapeUrlEncodedData(json_args, false);
return GURL(url);
-
}
// static
-void FileManagerUtil::ShowFullTabUrl(Profile*,
- const FilePath& dir) {
+void FileManagerUtil::ViewFolder(const FilePath& dir) {
Browser* browser = BrowserList::GetLastActive();
if (!browser)
return;
@@ -254,6 +257,7 @@
browser->ShowSingletonTabRespectRef(GURL(url));
}
+// static
void FileManagerUtil::ViewItem(const FilePath& full_path, bool enqueue) {
std::string ext = full_path.Extension();
// For things supported natively by the browser, we should open it
@@ -314,8 +318,7 @@
IDS_FILEBROWSER_ERROR_VIEWING_FILE_TITLE,
UTF8ToUTF16(full_path.BaseName().value())),
l10n_util::GetStringUTF16(
- IDS_FILEBROWSER_ERROR_VIEWING_FILE)
- ));
+ IDS_FILEBROWSER_ERROR_VIEWING_FILE)));
}
// static

Powered by Google App Engine
This is Rietveld 408576698