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

Unified Diff: chrome/browser/ui/views/toolbar/toolbar_action_view.cc

Issue 1492423003: Rejigger ThemeService: move exposure of ThemeProvider interface to a (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: respond to comments Created 5 years 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
Index: chrome/browser/ui/views/toolbar/toolbar_action_view.cc
diff --git a/chrome/browser/ui/views/toolbar/toolbar_action_view.cc b/chrome/browser/ui/views/toolbar/toolbar_action_view.cc
index 524fb9525cedfeabefa855b52dad6f68772f4f7d..735b73ad570e847951e162a59e1c3ba034414eeb 100644
--- a/chrome/browser/ui/views/toolbar/toolbar_action_view.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_action_view.cc
@@ -10,8 +10,6 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/session_tab_helper.h"
-#include "chrome/browser/themes/theme_service.h"
-#include "chrome/browser/themes/theme_service_factory.h"
#include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h"
#include "chrome/browser/ui/toolbar/toolbar_actions_bar.h"
#include "chrome/browser/ui/view_ids.h"
@@ -86,14 +84,6 @@ ToolbarActionView::ToolbarActionView(
kInkDropLargeSize, kInkDropLargeCornerRadius, kInkDropSmallSize,
kInkDropSmallCornerRadius);
- // We also listen for browser theme changes on linux because a switch from or
- // to GTK requires that we regrab our browser action images.
- registrar_.Add(
- this,
- chrome::NOTIFICATION_BROWSER_THEME_CHANGED,
- content::Source<ThemeService>(
- ThemeServiceFactory::GetForProfile(profile_)));
-
// If the button is within a menu, we need to make it focusable in order to
// have it accessible via keyboard navigation, but it shouldn't request focus
// (because that would close the menu).
@@ -157,9 +147,8 @@ void ToolbarActionView::UpdateState() {
GetPreferredSize()).AsImageSkia());
if (!icon.isNull()) {
- ThemeService* theme = ThemeServiceFactory::GetForProfile(profile_);
-
- gfx::ImageSkia bg = *theme->GetImageSkiaNamed(IDR_BROWSER_ACTION);
+ gfx::ImageSkia bg = *ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
+ IDR_BROWSER_ACTION);
SetImage(views::Button::STATE_NORMAL,
gfx::ImageSkiaOperations::CreateSuperimposedImage(bg, icon));
}
@@ -184,13 +173,6 @@ void ToolbarActionView::OnMenuButtonClicked(views::View* sender,
}
}
-void ToolbarActionView::Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- DCHECK_EQ(chrome::NOTIFICATION_BROWSER_THEME_CHANGED, type);
- UpdateState();
-}
-
void ToolbarActionView::AddInkDropLayer(ui::Layer* ink_drop_layer) {
SetPaintToLayer(true);
SetFillsBoundsOpaquely(false);

Powered by Google App Engine
This is Rietveld 408576698