| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ | 6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" | 12 #include "chrome/browser/tab_contents/infobar_delegate.h" |
| 13 #include "chrome/browser/translate/translate_prefs.h" | 13 #include "chrome/browser/translate/translate_prefs.h" |
| 14 #include "chrome/common/translate_errors.h" | 14 #include "chrome/common/translate_errors.h" |
| 15 | 15 |
| 16 class SkBitmap; | 16 class SkBitmap; |
| 17 class TranslateInfoBarView; | 17 class TranslateInfoBarView; |
| 18 | 18 |
| 19 class TranslateInfoBarDelegate : public InfoBarDelegate { | 19 class TranslateInfoBarDelegate : public InfoBarDelegate { |
| 20 public: | 20 public: |
| 21 // The different types of infobars that can be shown for translation. | 21 // The different types of infobars that can be shown for translation. |
| 22 enum Type { | 22 enum Type { |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 Type type_; | 156 Type type_; |
| 157 | 157 |
| 158 private: | 158 private: |
| 159 typedef std::pair<std::string, string16> LanguageNamePair; | 159 typedef std::pair<std::string, string16> LanguageNamePair; |
| 160 | 160 |
| 161 // InfoBarDelegate: | 161 // InfoBarDelegate: |
| 162 virtual InfoBar* CreateInfoBar() OVERRIDE; | 162 virtual InfoBar* CreateInfoBar() OVERRIDE; |
| 163 virtual void InfoBarDismissed() OVERRIDE; | 163 virtual void InfoBarDismissed() OVERRIDE; |
| 164 virtual gfx::Image* GetIcon() const OVERRIDE; | 164 virtual gfx::Image* GetIcon() const OVERRIDE; |
| 165 virtual InfoBarDelegate::Type GetInfoBarType() const OVERRIDE; | 165 virtual InfoBarDelegate::Type GetInfoBarType() const OVERRIDE; |
| 166 virtual bool ShouldExpire( |
| 167 const NavigationController::LoadCommittedDetails& details) const; |
| 166 virtual TranslateInfoBarDelegate* AsTranslateInfoBarDelegate() OVERRIDE; | 168 virtual TranslateInfoBarDelegate* AsTranslateInfoBarDelegate() OVERRIDE; |
| 167 | 169 |
| 168 // Gets the host of the page being translated, or an empty string if no URL is | 170 // Gets the host of the page being translated, or an empty string if no URL is |
| 169 // associated with the current page. | 171 // associated with the current page. |
| 170 std::string GetPageHost(); | 172 std::string GetPageHost(); |
| 171 | 173 |
| 172 // The type of fading animation if any that should be used when showing this | 174 // The type of fading animation if any that should be used when showing this |
| 173 // infobar. | 175 // infobar. |
| 174 BackgroundAnimationType background_animation_; | 176 BackgroundAnimationType background_animation_; |
| 175 | 177 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 200 // The current infobar view. | 202 // The current infobar view. |
| 201 TranslateInfoBarView* infobar_view_; | 203 TranslateInfoBarView* infobar_view_; |
| 202 | 204 |
| 203 // The translation related preferences. | 205 // The translation related preferences. |
| 204 TranslatePrefs prefs_; | 206 TranslatePrefs prefs_; |
| 205 | 207 |
| 206 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); | 208 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); |
| 207 }; | 209 }; |
| 208 | 210 |
| 209 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ | 211 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ |
| OLD | NEW |