summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/app/generated_resources.grd7
-rw-r--r--chrome/browser/chromeos/extensions/file_browser_private_api.cc7
-rw-r--r--chrome/browser/chromeos/extensions/file_manager_util.cc46
-rw-r--r--chrome/browser/chromeos/extensions/file_manager_util.h2
-rw-r--r--chrome/browser/resources/file_manager/js/file_manager.js24
-rw-r--r--chrome/browser/resources/file_manager/js/mock_chrome.js3
-rw-r--r--chrome/browser/resources/file_manager/manifest.json27
7 files changed, 27 insertions, 89 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 0865ffd..8790742 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -9965,13 +9965,6 @@ Some features may be unavailable. Please check that the profile exists and you
Format device
</message>
- <message name="IDS_FILE_BROWSER_OPEN_ACTION" desc="Title of the action for opening contents of the file.">
- Open
- </message>
- <message name="IDS_FILE_BROWSER_INSTALL_CRX" desc="Title of the action for installing extension from CRX file.">
- Open
- </message>
-
<message name="IDS_FILE_BROWSER_GALLERY" desc="Title of the action to open the Gallery.">
View and Edit
</message>
diff --git a/chrome/browser/chromeos/extensions/file_browser_private_api.cc b/chrome/browser/chromeos/extensions/file_browser_private_api.cc
index 1e6536b..117c237 100644
--- a/chrome/browser/chromeos/extensions/file_browser_private_api.cc
+++ b/chrome/browser/chromeos/extensions/file_browser_private_api.cc
@@ -1781,9 +1781,6 @@ bool FileDialogStringsFunction::RunImpl() {
SET_STRING(IDS_FILE_BROWSER, MOUNT_ARCHIVE);
SET_STRING(IDS_FILE_BROWSER, FORMAT_DEVICE);
- SET_STRING(IDS_FILE_BROWSER, OPEN_ACTION);
- SET_STRING(IDS_FILE_BROWSER, INSTALL_CRX);
-
SET_STRING(IDS_FILE_BROWSER, GALLERY);
SET_STRING(IDS_FILE_BROWSER, GALLERY_EDIT);
SET_STRING(IDS_FILE_BROWSER, GALLERY_SHARE);
@@ -1915,10 +1912,6 @@ bool FileDialogStringsFunction::RunImpl() {
SET_STRING(IDS_FILE_BROWSER, ENQUEUE);
#undef SET_STRING
- dict->SetString("PDF_VIEW_ENABLED",
- file_manager_util::ShouldBeOpenedWithPdfPlugin(".pdf") ?
- "true" : "false");
-
ChromeURLDataManager::DataSource::SetFontAndTextDirection(dict);
dict->SetString("PLAY_MEDIA",
diff --git a/chrome/browser/chromeos/extensions/file_manager_util.cc b/chrome/browser/chromeos/extensions/file_manager_util.cc
index 08467fd..e4de851 100644
--- a/chrome/browser/chromeos/extensions/file_manager_util.cc
+++ b/chrome/browser/chromeos/extensions/file_manager_util.cc
@@ -122,6 +122,29 @@ bool IsCRXFile(const char* file_extension) {
return base::strcasecmp(file_extension, kCRXExtension) == 0;
}
+// If pdf plugin is enabled, we should open pdf files in a tab.
+bool ShouldBeOpenedWithPdfPlugin(const char* file_extension) {
+ if (base::strcasecmp(file_extension, kPdfExtension) != 0)
+ return false;
+
+ Browser* browser = BrowserList::GetLastActive();
+ if (!browser)
+ return false;
+
+ FilePath pdf_path;
+ PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf_path);
+
+ webkit::WebPluginInfo plugin;
+ if (!PluginService::GetInstance()->GetPluginInfoByPath(pdf_path, &plugin))
+ return false;
+
+ PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(browser->profile());
+ if (!plugin_prefs)
+ return false;
+
+ return plugin_prefs->IsPluginEnabled(plugin);
+}
+
// 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 *file_extension,
@@ -445,27 +468,4 @@ void InstallCRX(Profile* profile, const FilePath& full_path) {
installer->InstallCrx(full_path);
}
-// If pdf plugin is enabled, we should open pdf files in a tab.
-bool ShouldBeOpenedWithPdfPlugin(const char* file_extension) {
- if (base::strcasecmp(file_extension, kPdfExtension) != 0)
- return false;
-
- Browser* browser = BrowserList::GetLastActive();
- if (!browser)
- return false;
-
- FilePath pdf_path;
- PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf_path);
-
- webkit::WebPluginInfo plugin;
- if (!PluginService::GetInstance()->GetPluginInfoByPath(pdf_path, &plugin))
- return false;
-
- PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(browser->profile());
- if (!plugin_prefs)
- return false;
-
- return plugin_prefs->IsPluginEnabled(plugin);
-}
-
} // namespace file_manager_util
diff --git a/chrome/browser/chromeos/extensions/file_manager_util.h b/chrome/browser/chromeos/extensions/file_manager_util.h
index 7e520ef..689b0f2 100644
--- a/chrome/browser/chromeos/extensions/file_manager_util.h
+++ b/chrome/browser/chromeos/extensions/file_manager_util.h
@@ -66,8 +66,6 @@ bool TryViewingFile(const FilePath& file);
void InstallCRX(Profile* profile, const FilePath& full_path);
-bool ShouldBeOpenedWithPdfPlugin(const char* file_extension);
-
} // namespace file_manager_util
#endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_UTIL_H_
diff --git a/chrome/browser/resources/file_manager/js/file_manager.js b/chrome/browser/resources/file_manager/js/file_manager.js
index ada15f3..001348f 100644
--- a/chrome/browser/resources/file_manager/js/file_manager.js
+++ b/chrome/browser/resources/file_manager/js/file_manager.js
@@ -2164,7 +2164,6 @@ FileManager.prototype = {
FileManager.prototype.onTasksFound_ = function(selection, tasksList) {
this.taskItems_.clear();
- var tasksCount = 0;
for (var i = 0; i < tasksList.length; i++) {
var task = tasksList[i];
@@ -2186,30 +2185,15 @@ FileManager.prototype = {
} else if (task_parts[1] == 'gallery') {
task.iconUrl =
chrome.extension.getURL('images/icon_preview_16x16.png');
- task.title = str('OPEN_ACTION');
+ task.title = str('GALLERY');
task.allTasks = tasksList;
- } else if (task_parts[1] == 'view-pdf') {
- // Do not render this task if disabled.
- if (str('PDF_VIEW_ENABLED') == 'false') continue;
- task.iconUrl =
- chrome.extension.getURL('images/icon_preview_16x16.png');
- task.title = str('OPEN_ACTION');
- } else if (task_parts[1] == 'view-txt') {
- task.iconUrl =
- chrome.extension.getURL('images/icon_preview_16x16.png');
- task.title = str('OPEN_ACTION');
- } else if (task_parts[1] == 'install-crx') {
- // TODO(dgozman): change to the right icon.
- task.iconUrl =
- chrome.extension.getURL('images/icon_preview_16x16.png');
- task.title = str('INSTALL_CRX');
+ this.galleryTask_ = task;
}
}
this.renderTaskItem_(task);
- tasksCount++;
}
- this.taskItems_.visible = tasksCount > 0;
+ this.taskItems_.visible = tasksList.length > 0;
selection.tasksList = tasksList;
if (selection.dispatchDefault) {
@@ -2461,8 +2445,6 @@ FileManager.prototype = {
}
}
this.openGallery_(urls, noGallery);
- } else if (id == 'view-pdf' || id == 'view-txt' || id == 'install-crx') {
- chrome.fileBrowserPrivate.viewFiles(urls, 'default', function() {});
}
};
diff --git a/chrome/browser/resources/file_manager/js/mock_chrome.js b/chrome/browser/resources/file_manager/js/mock_chrome.js
index 0621179..922ef33 100644
--- a/chrome/browser/resources/file_manager/js/mock_chrome.js
+++ b/chrome/browser/resources/file_manager/js/mock_chrome.js
@@ -322,9 +322,6 @@ chrome.fileBrowserPrivate = {
MOUNT_ARCHIVE: 'Open',
FORMAT_DEVICE: 'Format device',
- OPEN_ACTION: 'Open',
- INSTALL_CRX: 'Open',
-
GALLERY: 'View and Edit',
GALLERY_EDIT: 'Edit',
GALLERY_SHARE: 'Share',
diff --git a/chrome/browser/resources/file_manager/manifest.json b/chrome/browser/resources/file_manager/manifest.json
index b1ef6ee..34fbea4 100644
--- a/chrome/browser/resources/file_manager/manifest.json
+++ b/chrome/browser/resources/file_manager/manifest.json
@@ -56,33 +56,8 @@
]
},
{
- "id": "view-pdf",
- "default_title": "__MSG_OPEN_ACTION__",
- "default_icon": "images/icon_preview_16x16.png",
- "file_filters": [
- "filesystem:*.pdf"
- ]
- },
- {
- "id": "view-txt",
- "default_title": "__MSG_OPEN_ACTION__",
- "default_icon": "images/icon_preview_16x16.png",
- "file_filters": [
- "filesystem:*.txt"
- ]
- },
- {
- "id": "install-crx",
- "default_title": "__MSG_INSTALL_CRX__",
- // TODO(dgozman): replace to the right icon.
- "default_icon": "images/icon_preview_16x16.png",
- "file_filters": [
- "filesystem:*.crx"
- ]
- },
- {
"id": "gallery",
- "default_title": "__MSG_OPEN_ACTION__",
+ "default_title": "__MSG_GALLERY__",
"default_icon": "images/icon_preview_16x16.png",
"file_filters": [
// Image formats