| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 TabContents* tab_contents, | 153 TabContents* tab_contents, |
| 154 const std::string& original_language, | 154 const std::string& original_language, |
| 155 const std::string& target_language); | 155 const std::string& target_language); |
| 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(); | 162 virtual InfoBar* CreateInfoBar(); |
| 163 virtual bool ShouldExpire( |
| 164 const NavigationController::LoadCommittedDetails& details) const; |
| 163 virtual void InfoBarDismissed(); | 165 virtual void InfoBarDismissed(); |
| 164 virtual void InfoBarClosed(); | 166 virtual void InfoBarClosed(); |
| 165 virtual gfx::Image* GetIcon() const; | 167 virtual gfx::Image* GetIcon() const; |
| 166 virtual InfoBarDelegate::Type GetInfoBarType() const; | 168 virtual InfoBarDelegate::Type GetInfoBarType() const; |
| 167 virtual TranslateInfoBarDelegate* AsTranslateInfoBarDelegate(); | 169 virtual TranslateInfoBarDelegate* AsTranslateInfoBarDelegate(); |
| 168 | 170 |
| 169 // Gets the host of the page being translated, or an empty string if no URL is | 171 // Gets the host of the page being translated, or an empty string if no URL is |
| 170 // associated with the current page. | 172 // associated with the current page. |
| 171 std::string GetPageHost(); | 173 std::string GetPageHost(); |
| 172 | 174 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 201 // The current infobar view. | 203 // The current infobar view. |
| 202 TranslateInfoBarView* infobar_view_; | 204 TranslateInfoBarView* infobar_view_; |
| 203 | 205 |
| 204 // The translation related preferences. | 206 // The translation related preferences. |
| 205 TranslatePrefs prefs_; | 207 TranslatePrefs prefs_; |
| 206 | 208 |
| 207 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); | 209 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); |
| 208 }; | 210 }; |
| 209 | 211 |
| 210 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ | 212 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ |
| OLD | NEW |