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_UI_DELEGATE_H_ | 5 #ifndef COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_UI_DELEGATE_H_ |
6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_UI_DELEGATE_H_ | 6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_UI_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
15 #include "components/translate/core/common/translate_errors.h" | 15 #include "components/translate/core/common/translate_errors.h" |
16 | 16 |
17 class LanguageState; | 17 class LanguageState; |
18 class TranslateClient; | 18 class TranslateClient; |
19 class TranslateDriver; | 19 class TranslateDriver; |
20 class TranslateManager; | 20 class TranslateManager; |
21 class TranslatePrefs; | 21 class TranslatePrefs; |
22 | 22 |
23 // The TranslateUIDelegate is a generic delegate for UI which offers Translate | 23 // The TranslateUIDelegate is a generic delegate for UI which offers Translate |
24 // feature to the user. | 24 // feature to the user. |
25 class TranslateUIDelegate { | 25 class TranslateUIDelegate { |
26 public: | 26 public: |
27 enum { NO_INDEX = -1, }; | 27 static const size_t kNoIndex = static_cast<size_t>(-1); |
28 | 28 |
29 TranslateUIDelegate(const base::WeakPtr<TranslateManager>& translate_manager, | 29 TranslateUIDelegate(const base::WeakPtr<TranslateManager>& translate_manager, |
30 const std::string& original_language, | 30 const std::string& original_language, |
31 const std::string& target_language); | 31 const std::string& target_language); |
32 virtual ~TranslateUIDelegate(); | 32 virtual ~TranslateUIDelegate(); |
33 | 33 |
34 // Handles when an error message is shown. | 34 // Handles when an error message is shown. |
35 void OnErrorShown(TranslateErrors::Type error_type); | 35 void OnErrorShown(TranslateErrors::Type error_type); |
36 | 36 |
37 // Returns the LanguageState associated with this object. | 37 // Returns the LanguageState associated with this object. |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 // The index for language the page should be translated to. | 122 // The index for language the page should be translated to. |
123 size_t target_language_index_; | 123 size_t target_language_index_; |
124 | 124 |
125 // The translation related preferences. | 125 // The translation related preferences. |
126 scoped_ptr<TranslatePrefs> prefs_; | 126 scoped_ptr<TranslatePrefs> prefs_; |
127 | 127 |
128 DISALLOW_COPY_AND_ASSIGN(TranslateUIDelegate); | 128 DISALLOW_COPY_AND_ASSIGN(TranslateUIDelegate); |
129 }; | 129 }; |
130 | 130 |
131 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_UI_DELEGATE_H_ | 131 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_UI_DELEGATE_H_ |
OLD | NEW |