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

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: Rebasing 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 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 <string> 7 #include <string>
8 8
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 registrar_.RemoveAll(); 101 registrar_.RemoveAll();
102 102
103 theme_service_->OnInfobarDestroyed(); 103 theme_service_->OnInfobarDestroyed();
104 } 104 }
105 105
106 infobars::InfoBarDelegate::Type 106 infobars::InfoBarDelegate::Type
107 ThemeInstalledInfoBarDelegate::GetInfoBarType() const { 107 ThemeInstalledInfoBarDelegate::GetInfoBarType() const {
108 return PAGE_ACTION_TYPE; 108 return PAGE_ACTION_TYPE;
109 } 109 }
110 110
111 std::string ThemeInstalledInfoBarDelegate::GetIdentifier() const {
112 return "ThemeInstalledInfoBarDelegate";
113 }
114
111 int ThemeInstalledInfoBarDelegate::GetIconId() const { 115 int ThemeInstalledInfoBarDelegate::GetIconId() const {
112 return IDR_INFOBAR_THEME; 116 return IDR_INFOBAR_THEME;
113 } 117 }
114 118
115 gfx::VectorIconId ThemeInstalledInfoBarDelegate::GetVectorIconId() const { 119 gfx::VectorIconId ThemeInstalledInfoBarDelegate::GetVectorIconId() const {
116 #if defined(OS_MACOSX) 120 #if defined(OS_MACOSX)
117 return gfx::VectorIconId::VECTOR_ICON_NONE; 121 return gfx::VectorIconId::VECTOR_ICON_NONE;
118 #else 122 #else
119 return gfx::VectorIconId::PAINTBRUSH; 123 return gfx::VectorIconId::PAINTBRUSH;
120 #endif 124 #endif
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 void ThemeInstalledInfoBarDelegate::Observe( 164 void ThemeInstalledInfoBarDelegate::Observe(
161 int type, 165 int type,
162 const content::NotificationSource& source, 166 const content::NotificationSource& source,
163 const content::NotificationDetails& details) { 167 const content::NotificationDetails& details) {
164 DCHECK_EQ(chrome::NOTIFICATION_BROWSER_THEME_CHANGED, type); 168 DCHECK_EQ(chrome::NOTIFICATION_BROWSER_THEME_CHANGED, type);
165 // If the new theme is different from what this info bar is associated with, 169 // If the new theme is different from what this info bar is associated with,
166 // close this info bar since it is no longer relevant. 170 // close this info bar since it is no longer relevant.
167 if (theme_id_ != theme_service_->GetThemeID()) 171 if (theme_id_ != theme_service_->GetThemeID())
168 infobar()->RemoveSelf(); 172 infobar()->RemoveSelf();
169 } 173 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698