diff options
author | achuith@chromium.org <achuith@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-16 10:23:00 +0000 |
---|---|---|
committer | achuith@chromium.org <achuith@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-16 10:23:00 +0000 |
commit | db3b7628d9f80eb98477fd4863c67c53fc84d56c (patch) | |
tree | 330a2c334fcc80a30ba09dae380f253f55dff95d /chrome/browser | |
parent | d66bbe0598b429b04b17e928cec7417b819a3a9c (diff) | |
download | chromium_src-db3b7628d9f80eb98477fd4863c67c53fc84d56c.zip chromium_src-db3b7628d9f80eb98477fd4863c67c53fc84d56c.tar.gz chromium_src-db3b7628d9f80eb98477fd4863c67c53fc84d56c.tar.bz2 |
Change "Show All Downloads" link to "Show all files". Takes you to the file manager.
BUG=chromium-os:22871
TEST=download a file on cros, link at the bottom of the downloads panel should say "Show all files". Clicking on it should open the filemanager at the downloads folder location.
Review URL: http://codereview.chromium.org/8528046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110279 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/resources/active_downloads.html | 8 | ||||
-rw-r--r-- | chrome/browser/resources/active_downloads.js | 14 | ||||
-rw-r--r-- | chrome/browser/ui/webui/active_downloads_ui.cc | 23 |
3 files changed, 28 insertions, 17 deletions
diff --git a/chrome/browser/resources/active_downloads.html b/chrome/browser/resources/active_downloads.html index 9d23262..6d4303c 100644 --- a/chrome/browser/resources/active_downloads.html +++ b/chrome/browser/resources/active_downloads.html @@ -131,7 +131,7 @@ div.columnlist { background: #e8e8e8 } -span.showalldownloadstext { +span.showallfilestext { color: #254f9b; cursor: pointer; text-decoration: underline; @@ -139,7 +139,7 @@ span.showalldownloadstext { height: 15px; } -div.showalldownloads { +div.showallfiles { width: 100%; bottom: 0; height: 29px; @@ -191,8 +191,8 @@ div.showalldownloads { <script src="chrome://active-downloads/active_downloads.js"></script> <body i18n-values=".style.fontFamily:fontfamily"> <div id="main" class="columnlist"></div> -<div id="showalldownloads" class="showalldownloads"> - <span id="showalldownloadstext" class="showalldownloadstext"></span> +<div id="showallfiles" class="showallfiles"> + <span id="showallfilestext" class="showallfilestext"></span> </div> <script src="chrome://resources/js/i18n_template.js"></script> <script src="chrome://resources/js/i18n_process.js"></script> diff --git a/chrome/browser/resources/active_downloads.js b/chrome/browser/resources/active_downloads.js index 82161f8..5908c3c 100644 --- a/chrome/browser/resources/active_downloads.js +++ b/chrome/browser/resources/active_downloads.js @@ -55,9 +55,9 @@ function init() { document.body.addEventListener("selectstart", function (e) { e.preventDefault(); }); - var sadt = $('showalldownloadstext'); - sadt.textContent = localStrings.getString('showalldownloads'); - sadt.addEventListener("click", showAllDownloads); + var sadt = $('showallfilestext'); + sadt.textContent = localStrings.getString('showallfiles'); + sadt.addEventListener("click", showAllFiles); downloadRowList = new DownloadRowList(); chromeSend('getDownloads'); @@ -77,8 +77,8 @@ function initTestHarness() { // Fix localStrings. localStrings = { getString: function(name) { - if (name == 'showalldownloads') - return 'Show All Downloads'; + if (name == 'showallfiles') + return 'Show all files'; if (name == 'dangerousextension') return 'Extensions, apps, and themes can harm your computer.' + ' Are you sure you want to continue?' @@ -191,8 +191,8 @@ function downloadUpdated(result) { downloadRowList.update(result); } -function showAllDownloads() { - chromeSend('openNewFullWindow', 'chrome://downloads'); +function showAllFiles() { + chromeSend('showAllFiles'); } /** diff --git a/chrome/browser/ui/webui/active_downloads_ui.cc b/chrome/browser/ui/webui/active_downloads_ui.cc index d9a3327..f5d79bb 100644 --- a/chrome/browser/ui/webui/active_downloads_ui.cc +++ b/chrome/browser/ui/webui/active_downloads_ui.cc @@ -24,9 +24,11 @@ #include "base/values.h" #include "chrome/browser/chromeos/cros/cros_library.h" #include "chrome/browser/chromeos/media/media_player.h" +#include "chrome/browser/download/download_prefs.h" #include "chrome/browser/download/download_service.h" #include "chrome/browser/download/download_service_factory.h" #include "chrome/browser/download/download_util.h" +#include "chrome/browser/extensions/file_manager_util.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/ui/browser.h" @@ -55,7 +57,7 @@ static const int kPopupLeft = 0; static const int kPopupTop = 0; static const int kPopupWidth = 250; // Minimum height of window must be 100, so kPopupHeight has space for -// 2 download rows of 36 px and 'Show All Downloads' which is 29px. +// 2 download rows of 36 px and 'Show all files' link which is 29px. static const int kPopupHeight = 36 * 2 + 29; static const char kPropertyPath[] = "path"; @@ -76,8 +78,8 @@ ChromeWebUIDataSource* CreateActiveDownloadsUIHTMLSource() { source->AddLocalizedString("continue", IDS_CONTINUE_EXTENSION_DOWNLOAD); source->AddLocalizedString("pause", IDS_DOWNLOAD_LINK_PAUSE); source->AddLocalizedString("resume", IDS_DOWNLOAD_LINK_RESUME); - source->AddLocalizedString("showalldownloads", - IDS_FILEBROWSER_SHOW_ALL_DOWNLOADS); + source->AddLocalizedString("showallfiles", + IDS_FILE_BROWSER_MORE_FILES); source->AddLocalizedString("error_unknown_file_type", IDS_FILEBROWSER_ERROR_UNKNOWN_FILE_TYPE); @@ -129,8 +131,9 @@ class ActiveDownloadsHandler // WebUI Callbacks. void HandleGetDownloads(const ListValue* args); void HandlePauseToggleDownload(const ListValue* args); - void HandleCancelDownload(const ListValue* args); void HandleAllowDownload(const ListValue* args); + void HandleCancelDownload(const ListValue* args); + void HandleShowAllFiles(const ListValue* args); void OpenNewFullWindow(const ListValue* args); void PlayMediaFile(const ListValue* args); @@ -189,11 +192,14 @@ void ActiveDownloadsHandler::RegisterMessages() { web_ui_->RegisterMessageCallback("pauseToggleDownload", base::Bind(&ActiveDownloadsHandler::HandlePauseToggleDownload, base::Unretained(this))); + web_ui_->RegisterMessageCallback("allowDownload", + base::Bind(&ActiveDownloadsHandler::HandleAllowDownload, + base::Unretained(this))); web_ui_->RegisterMessageCallback("cancelDownload", base::Bind(&ActiveDownloadsHandler::HandleCancelDownload, base::Unretained(this))); - web_ui_->RegisterMessageCallback("allowDownload", - base::Bind(&ActiveDownloadsHandler::HandleAllowDownload, + web_ui_->RegisterMessageCallback("showAllFiles", + base::Bind(&ActiveDownloadsHandler::HandleShowAllFiles, base::Unretained(this))); web_ui_->RegisterMessageCallback("openNewFullWindow", base::Bind(&ActiveDownloadsHandler::OpenNewFullWindow, @@ -243,6 +249,11 @@ void ActiveDownloadsHandler::HandleCancelDownload(const ListValue* args) { } } +void ActiveDownloadsHandler::HandleShowAllFiles(const ListValue* args) { + FileManagerUtil::ViewFolder( + DownloadPrefs::FromDownloadManager(download_manager_)->download_path()); +} + bool ActiveDownloadsHandler::SelectTab(const GURL& url) { for (TabContentsIterator it; !it.done(); ++it) { TabContents* tab_contents = it->tab_contents(); |