Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_INFOBAR_DELEGATE_H_ | 5 #ifndef COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_INFOBAR_DELEGATE_H_ |
| 6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_INFOBAR_DELEGATE_H_ | 6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_INFOBAR_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 class TranslateDriver; | 35 class TranslateDriver; |
| 36 class TranslateManager; | 36 class TranslateManager; |
| 37 | 37 |
| 38 class TranslateInfoBarDelegate : public infobars::InfoBarDelegate { | 38 class TranslateInfoBarDelegate : public infobars::InfoBarDelegate { |
| 39 public: | 39 public: |
| 40 // An observer to handle different translate steps' UI changes. | 40 // An observer to handle different translate steps' UI changes. |
| 41 class Observer { | 41 class Observer { |
| 42 public: | 42 public: |
| 43 // Handles UI changes on the translate step given. | 43 // Handles UI changes on the translate step given. |
| 44 virtual void OnTranslateStepChanged(translate::TranslateStep step, | 44 virtual void OnTranslateStepChanged(translate::TranslateStep step, |
| 45 TranslateErrors::Type error_type){}; | 45 TranslateErrors::Type error_type) = 0; |
| 46 // Return whether user declined translate service. | 46 // Return whether user declined translate service. |
| 47 virtual bool IsDeclinedByUser(); | 47 virtual bool IsDeclinedByUser() = 0; |
|
napper
2017/05/25 01:25:07
Seems like IsDeclinedByUser() should be a const me
| |
| 48 | 48 |
| 49 protected: | 49 protected: |
| 50 virtual ~Observer() {} | 50 virtual ~Observer() {} |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 static const size_t kNoIndex; | 53 static const size_t kNoIndex; |
| 54 | 54 |
| 55 ~TranslateInfoBarDelegate() override; | 55 ~TranslateInfoBarDelegate() override; |
| 56 | 56 |
| 57 // Factory method to create a translate infobar. |error_type| must be | 57 // Factory method to create a translate infobar. |error_type| must be |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 236 // A observer to handle front-end changes on different steps. | 236 // A observer to handle front-end changes on different steps. |
| 237 // It's only used when we try to reuse the existing UI. | 237 // It's only used when we try to reuse the existing UI. |
| 238 Observer* observer_; | 238 Observer* observer_; |
| 239 | 239 |
| 240 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); | 240 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); |
| 241 }; | 241 }; |
| 242 | 242 |
| 243 } // namespace translate | 243 } // namespace translate |
| 244 | 244 |
| 245 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_INFOBAR_DELEGATE_H_ | 245 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_INFOBAR_DELEGATE_H_ |
| OLD | NEW |