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

Side by Side Diff: chrome/browser/extensions/theme_installed_infobar_delegate.cc

Issue 1520543004: Add method for identifying different InfoBars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit again Created 4 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/theme_installed_infobar_delegate.h" 5 #include "chrome/browser/extensions/theme_installed_infobar_delegate.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 registrar_.RemoveAll(); 104 registrar_.RemoveAll();
105 105
106 theme_service_->OnInfobarDestroyed(); 106 theme_service_->OnInfobarDestroyed();
107 } 107 }
108 108
109 infobars::InfoBarDelegate::Type 109 infobars::InfoBarDelegate::Type
110 ThemeInstalledInfoBarDelegate::GetInfoBarType() const { 110 ThemeInstalledInfoBarDelegate::GetInfoBarType() const {
111 return PAGE_ACTION_TYPE; 111 return PAGE_ACTION_TYPE;
112 } 112 }
113 113
114 infobars::InfoBarDelegate::InfoBarIdentifier
115 ThemeInstalledInfoBarDelegate::GetIdentifier() const {
116 return THEME_INSTALLED_INFOBAR_DELEGATE;
117 }
118
114 int ThemeInstalledInfoBarDelegate::GetIconId() const { 119 int ThemeInstalledInfoBarDelegate::GetIconId() const {
115 return IDR_INFOBAR_THEME; 120 return IDR_INFOBAR_THEME;
116 } 121 }
117 122
118 gfx::VectorIconId ThemeInstalledInfoBarDelegate::GetVectorIconId() const { 123 gfx::VectorIconId ThemeInstalledInfoBarDelegate::GetVectorIconId() const {
119 #if defined(OS_MACOSX) 124 #if defined(OS_MACOSX)
120 return gfx::VectorIconId::VECTOR_ICON_NONE; 125 return gfx::VectorIconId::VECTOR_ICON_NONE;
121 #else 126 #else
122 return gfx::VectorIconId::PAINTBRUSH; 127 return gfx::VectorIconId::PAINTBRUSH;
123 #endif 128 #endif
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 void ThemeInstalledInfoBarDelegate::Observe( 168 void ThemeInstalledInfoBarDelegate::Observe(
164 int type, 169 int type,
165 const content::NotificationSource& source, 170 const content::NotificationSource& source,
166 const content::NotificationDetails& details) { 171 const content::NotificationDetails& details) {
167 DCHECK_EQ(chrome::NOTIFICATION_BROWSER_THEME_CHANGED, type); 172 DCHECK_EQ(chrome::NOTIFICATION_BROWSER_THEME_CHANGED, type);
168 // If the new theme is different from what this info bar is associated with, 173 // If the new theme is different from what this info bar is associated with,
169 // close this info bar since it is no longer relevant. 174 // close this info bar since it is no longer relevant.
170 if (theme_id_ != theme_service_->GetThemeID()) 175 if (theme_id_ != theme_service_->GetThemeID())
171 infobar()->RemoveSelf(); 176 infobar()->RemoveSelf();
172 } 177 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698