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

Unified Diff: chrome/browser/ui/gtk/location_bar_view_gtk.cc

Issue 10905005: Change browser/page action default icon defined in manifest to support hidpi. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: disable unittest on android Created 8 years, 3 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 | « chrome/browser/ui/gtk/location_bar_view_gtk.h ('k') | chrome/browser/ui/views/browser_action_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/location_bar_view_gtk.cc
diff --git a/chrome/browser/ui/gtk/location_bar_view_gtk.cc b/chrome/browser/ui/gtk/location_bar_view_gtk.cc
index 1badb152891515469902083564280f7ac4409bce..8f86c171c5db5ad9acf02723a626c2dbab64c3a9 100644
--- a/chrome/browser/ui/gtk/location_bar_view_gtk.cc
+++ b/chrome/browser/ui/gtk/location_bar_view_gtk.cc
@@ -1790,7 +1790,6 @@ LocationBarViewGtk::PageActionViewGtk::PageActionViewGtk(
ExtensionAction* page_action)
: owner_(NULL),
page_action_(page_action),
- tracker_(this),
current_tab_id_(-1),
window_(NULL),
accel_group_(NULL),
@@ -1821,13 +1820,8 @@ LocationBarViewGtk::PageActionViewGtk::PageActionViewGtk(
false);
DCHECK(extension);
- std::string path = page_action_->default_icon_path();
- if (!path.empty()) {
- tracker_.LoadImage(extension, extension->GetResource(path),
- gfx::Size(Extension::kPageActionIconMaxSize,
- Extension::kPageActionIconMaxSize),
- ImageLoadingTracker::DONT_CACHE);
- }
+ icon_factory_.reset(
+ new ExtensionActionIconFactory(extension, page_action, this));
// We set the owner last of all so that we can determine whether we are in
// the process of initializing this class or not.
@@ -1860,7 +1854,7 @@ void LocationBarViewGtk::PageActionViewGtk::UpdateVisibility(
page_action_->GetTitle(current_tab_id_).c_str());
// Set the image.
- gfx::Image icon = page_action_->GetIcon(current_tab_id_);
+ gfx::Image icon = icon_factory_->GetIcon(current_tab_id_);
if (!icon.IsEmpty()) {
GdkPixbuf* pixbuf = icon.ToGdkPixbuf();
DCHECK(pixbuf);
@@ -1882,12 +1876,7 @@ void LocationBarViewGtk::PageActionViewGtk::UpdateVisibility(
}
}
-void LocationBarViewGtk::PageActionViewGtk::OnImageLoaded(
- const gfx::Image& image,
- const std::string& extension_id,
- int index) {
- page_action_->CacheIcon(image);
-
+void LocationBarViewGtk::PageActionViewGtk::OnIconUpdated() {
// If we have no owner, that means this class is still being constructed.
TabContents* tab_contents = owner_ ? owner_->GetTabContents() : NULL;
if (tab_contents)
« no previous file with comments | « chrome/browser/ui/gtk/location_bar_view_gtk.h ('k') | chrome/browser/ui/views/browser_action_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698