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

Unified Diff: chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc

Issue 314183002: Cache network icon urls (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + Address feedback Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/system/chromeos/network/network_icon.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc
index f3312cd29dc8d762e0ced1ecc319664e34f986a5..82ffaa5a73f69595e7aac33fc8d7c418d2687fb9 100644
--- a/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc
@@ -312,13 +312,8 @@ bool HasPolicyForNetwork(const NetworkState* network,
}
void SetCommonNetworkInfo(const ManagedState* state,
- const gfx::ImageSkia& icon,
- float icon_scale_factor,
+ const std::string& icon_url,
base::DictionaryValue* network_info) {
- gfx::ImageSkiaRep image_rep =
- icon.GetRepresentation(icon_scale_factor);
- std::string icon_url =
- icon.isNull() ? "" : webui::GetBitmapDataUrl(image_rep.sk_bitmap());
network_info->SetString(kNetworkInfoKeyIconURL, icon_url);
std::string name = state->name();
@@ -347,9 +342,9 @@ base::DictionaryValue* BuildNetworkDictionary(
network_info->SetBoolean(kNetworkInfoKeyPolicyManaged,
HasPolicyForNetwork(network, profile_prefs));
- gfx::ImageSkia icon = ash::network_icon::GetImageForNetwork(
- network, ash::network_icon::ICON_TYPE_LIST);
- SetCommonNetworkInfo(network, icon, icon_scale_factor, network_info.get());
+ std::string icon_url = ash::network_icon::GetImageUrlForNetwork(
+ network, ash::network_icon::ICON_TYPE_LIST, icon_scale_factor);
+ SetCommonNetworkInfo(network, icon_url, network_info.get());
return network_info.release();
}
@@ -364,9 +359,9 @@ base::DictionaryValue* BuildFavoriteDictionary(
network_info->SetBoolean(kNetworkInfoKeyPolicyManaged,
HasPolicyForFavorite(favorite, profile_prefs));
- gfx::ImageSkia icon = ash::network_icon::GetImageForDisconnectedNetwork(
- ash::network_icon::ICON_TYPE_LIST, favorite->type());
- SetCommonNetworkInfo(favorite, icon, icon_scale_factor, network_info.get());
+ std::string icon_url = ash::network_icon::GetImageUrlForDisconnectedNetwork(
+ ash::network_icon::ICON_TYPE_LIST, favorite->type(), icon_scale_factor);
+ SetCommonNetworkInfo(favorite, icon_url, network_info.get());
return network_info.release();
}
« no previous file with comments | « ash/system/chromeos/network/network_icon.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698