Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 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 COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_INFOBAR_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ | 6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_INFOBAR_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "components/infobars/core/infobar_delegate.h" | 15 #include "components/infobars/core/infobar_delegate.h" |
| 16 #include "components/translate/core/browser/translate_prefs.h" | 16 #include "components/translate/core/browser/translate_prefs.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 188 private: | 188 private: |
| 189 friend class TranslationInfoBarTest; | 189 friend class TranslationInfoBarTest; |
| 190 typedef std::pair<std::string, base::string16> LanguageNamePair; | 190 typedef std::pair<std::string, base::string16> LanguageNamePair; |
| 191 | 191 |
| 192 // Returns a translate infobar that owns |delegate|. | 192 // Returns a translate infobar that owns |delegate|. |
| 193 static scoped_ptr<infobars::InfoBar> CreateInfoBar( | 193 static scoped_ptr<infobars::InfoBar> CreateInfoBar( |
| 194 scoped_ptr<TranslateInfoBarDelegate> delegate); | 194 scoped_ptr<TranslateInfoBarDelegate> delegate); |
| 195 | 195 |
| 196 // Gets the TranslateClient associated with this object. | 196 // Gets the TranslateClient associated with this object. |
| 197 // May return NULL if the client has been destroyed. | 197 // May return NULL if the client has been destroyed. |
| 198 TranslateClient* GetTranslateClient(); | 198 TranslateClient* GetTranslateClient() const; |
|
Peter Kasting
2014/05/21 20:38:24
Can't return a non-const pointer from a const func
droger
2014/05/22 12:33:37
Done.
| |
| 199 | 199 |
| 200 // InfoBarDelegate: | 200 // InfoBarDelegate: |
| 201 virtual void InfoBarDismissed() OVERRIDE; | 201 virtual void InfoBarDismissed() OVERRIDE; |
| 202 virtual int GetIconID() const OVERRIDE; | 202 virtual int GetIconID() const OVERRIDE; |
| 203 virtual infobars::InfoBarDelegate::Type GetInfoBarType() const OVERRIDE; | 203 virtual infobars::InfoBarDelegate::Type GetInfoBarType() const OVERRIDE; |
| 204 virtual bool ShouldExpire(const NavigationDetails& details) const OVERRIDE; | 204 virtual bool ShouldExpire(const NavigationDetails& details) const OVERRIDE; |
| 205 virtual TranslateInfoBarDelegate* AsTranslateInfoBarDelegate() OVERRIDE; | 205 virtual TranslateInfoBarDelegate* AsTranslateInfoBarDelegate() OVERRIDE; |
| 206 | 206 |
| 207 bool is_off_the_record_; | 207 bool is_off_the_record_; |
| 208 translate::TranslateStep step_; | 208 translate::TranslateStep step_; |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 219 | 219 |
| 220 // The translation related preferences. | 220 // The translation related preferences. |
| 221 scoped_ptr<TranslatePrefs> prefs_; | 221 scoped_ptr<TranslatePrefs> prefs_; |
| 222 | 222 |
| 223 // Whether the translation was triggered via a menu click vs automatically | 223 // Whether the translation was triggered via a menu click vs automatically |
| 224 // (due to language detection, preferences...) | 224 // (due to language detection, preferences...) |
| 225 bool triggered_from_menu_; | 225 bool triggered_from_menu_; |
| 226 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); | 226 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); |
| 227 }; | 227 }; |
| 228 | 228 |
| 229 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ | 229 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_INFOBAR_DELEGATE_H_ |
| OLD | NEW |