diff options
author | tengs@chromium.org <tengs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-22 23:09:49 +0000 |
---|---|---|
committer | tengs@chromium.org <tengs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-22 23:09:49 +0000 |
commit | 0ce0b781ceaceb6bb730e7ac5aa37240aa24e4d0 (patch) | |
tree | 843284f6eb3ab87146fede99d4ea085595f39b9b | |
parent | 7a64748380f1a289f288a669a87f2eb3deb29381 (diff) | |
download | chromium_src-0ce0b781ceaceb6bb730e7ac5aa37240aa24e4d0.zip chromium_src-0ce0b781ceaceb6bb730e7ac5aa37240aa24e4d0.tar.gz chromium_src-0ce0b781ceaceb6bb730e7ac5aa37240aa24e4d0.tar.bz2 |
Allow screenlockPrivate.showButton to be called with different icons.
TEST=manaul
Review URL: https://codereview.chromium.org/137233009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@246443 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/chromeos/login/screen_locker.cc | 10 | ||||
-rw-r--r-- | chrome/browser/ui/webui/chromeos/login/screenlock_icon_source.cc | 3 |
2 files changed, 8 insertions, 5 deletions
diff --git a/chrome/browser/chromeos/login/screen_locker.cc b/chrome/browser/chromeos/login/screen_locker.cc index 1383912..c4610a7 100644 --- a/chrome/browser/chromeos/login/screen_locker.cc +++ b/chrome/browser/chromeos/login/screen_locker.cc @@ -20,6 +20,7 @@ #include "base/memory/weak_ptr.h" #include "base/message_loop/message_loop.h" #include "base/metrics/histogram.h" +#include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/timer/timer.h" #include "chrome/browser/chrome_notification_types.h" @@ -318,10 +319,11 @@ void ScreenLocker::ShowUserPodButton(const std::string& username, return; screenlock_icon_provider_->AddIcon(username, icon); - delegate_->ShowUserPodButton( - username, - ScreenlockIconSource::GetIconURLForUser(username), - click_callback); + + // Append the current time to the URL so the image will not be cached. + std::string icon_url = ScreenlockIconSource::GetIconURLForUser(username) + + "?" + base::Int64ToString(base::Time::Now().ToInternalValue()); + delegate_->ShowUserPodButton(username, icon_url, click_callback); } void ScreenLocker::ShowErrorMessage(int error_msg_id, diff --git a/chrome/browser/ui/webui/chromeos/login/screenlock_icon_source.cc b/chrome/browser/ui/webui/chromeos/login/screenlock_icon_source.cc index 71c2f0b..50c6491 100644 --- a/chrome/browser/ui/webui/chromeos/login/screenlock_icon_source.cc +++ b/chrome/browser/ui/webui/chromeos/login/screenlock_icon_source.cc @@ -43,8 +43,9 @@ void ScreenlockIconSource::StartDataRequest( return; } + GURL url(chrome::kChromeUIScreenlockIconURL + path); std::string username = net::UnescapeURLComponent( - path, + url.path().substr(1), net::UnescapeRule::URL_SPECIAL_CHARS | net::UnescapeRule::SPACES); gfx::Image image = icon_provider_->GetIcon(username); |