| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_EXTENSIONS_THEME_INSTALLED_INFOBAR_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_THEME_INSTALLED_INFOBAR_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_THEME_INSTALLED_INFOBAR_DELEGATE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_THEME_INSTALLED_INFOBAR_DELEGATE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/tab_contents/infobar_delegate.h" | 9 #include "chrome/browser/tab_contents/infobar_delegate.h" |
| 10 #include "chrome/common/notification_registrar.h" | 10 #include "chrome/common/notification_registrar.h" |
| 11 | 11 |
| 12 class Extension; | 12 class Extension; |
| 13 class SkBitmap; | 13 class SkBitmap; |
| 14 class TabContents; | 14 class TabContents; |
| 15 | 15 |
| 16 // When a user installs a theme, we display it immediately, but provide an | 16 // When a user installs a theme, we display it immediately, but provide an |
| 17 // infobar allowing them to cancel. | 17 // infobar allowing them to cancel. |
| 18 class ThemeInstalledInfoBarDelegate : public ConfirmInfoBarDelegate, | 18 class ThemeInstalledInfoBarDelegate : public ConfirmInfoBarDelegate, |
| 19 public NotificationObserver { | 19 public NotificationObserver { |
| 20 public: | 20 public: |
| 21 ThemeInstalledInfoBarDelegate(TabContents* tab_contents, | 21 ThemeInstalledInfoBarDelegate(TabContents* tab_contents, |
| 22 const Extension* new_theme, | 22 const Extension* new_theme, |
| 23 const std::string& previous_theme_id); | 23 const std::string& previous_theme_id); |
| 24 virtual ~ThemeInstalledInfoBarDelegate(); | 24 virtual ~ThemeInstalledInfoBarDelegate(); |
| 25 virtual void InfoBarClosed(); | 25 virtual void InfoBarClosed(); |
| 26 virtual std::wstring GetMessageText() const; | 26 virtual string16 GetMessageText() const; |
| 27 virtual SkBitmap* GetIcon() const; | 27 virtual SkBitmap* GetIcon() const; |
| 28 virtual ThemeInstalledInfoBarDelegate* AsThemePreviewInfobarDelegate(); | 28 virtual ThemeInstalledInfoBarDelegate* AsThemePreviewInfobarDelegate(); |
| 29 virtual int GetButtons() const; | 29 virtual int GetButtons() const; |
| 30 virtual std::wstring GetButtonLabel( | 30 virtual string16 GetButtonLabel( |
| 31 ConfirmInfoBarDelegate::InfoBarButton button) const; | 31 ConfirmInfoBarDelegate::InfoBarButton button) const; |
| 32 virtual bool Cancel(); | 32 virtual bool Cancel(); |
| 33 | 33 |
| 34 // Returns true if the given theme is the same as the one associated with this | 34 // Returns true if the given theme is the same as the one associated with this |
| 35 // info bar. | 35 // info bar. |
| 36 bool MatchesTheme(Extension* theme); | 36 bool MatchesTheme(Extension* theme); |
| 37 | 37 |
| 38 // NotificationObserver implementation. | 38 // NotificationObserver implementation. |
| 39 virtual void Observe(NotificationType type, | 39 virtual void Observe(NotificationType type, |
| 40 const NotificationSource& source, | 40 const NotificationSource& source, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 55 std::string previous_theme_id_; | 55 std::string previous_theme_id_; |
| 56 | 56 |
| 57 // Tab to which this info bar is associated. | 57 // Tab to which this info bar is associated. |
| 58 TabContents* tab_contents_; | 58 TabContents* tab_contents_; |
| 59 | 59 |
| 60 // Registers and unregisters us for notifications. | 60 // Registers and unregisters us for notifications. |
| 61 NotificationRegistrar registrar_; | 61 NotificationRegistrar registrar_; |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 #endif // CHROME_BROWSER_EXTENSIONS_THEME_INSTALLED_INFOBAR_DELEGATE_H_ | 64 #endif // CHROME_BROWSER_EXTENSIONS_THEME_INSTALLED_INFOBAR_DELEGATE_H_ |
| OLD | NEW |