Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(873)

Side by Side Diff: chrome/renderer/translate_helper.h

Issue 11361051: Remove dependency on language detection library. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/renderer/translate_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_RENDERER_TRANSLATE_HELPER_H_ 5 #ifndef CHROME_RENDERER_TRANSLATE_HELPER_H_
6 #define CHROME_RENDERER_TRANSLATE_HELPER_H_ 6 #define CHROME_RENDERER_TRANSLATE_HELPER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // Used in unit-tests. Makes the various tasks be posted immediately so that 63 // Used in unit-tests. Makes the various tasks be posted immediately so that
64 // the tests don't have to wait before checking states. 64 // the tests don't have to wait before checking states.
65 virtual bool DontDelayTasks(); 65 virtual bool DontDelayTasks();
66 66
67 private: 67 private:
68 // Returns whether the page associated with |document| is a candidate for 68 // Returns whether the page associated with |document| is a candidate for
69 // translation. Some pages can explictly specify (via a meta-tag) that they 69 // translation. Some pages can explictly specify (via a meta-tag) that they
70 // should not be translated. 70 // should not be translated.
71 static bool IsPageTranslatable(WebKit::WebDocument* document); 71 static bool IsPageTranslatable(WebKit::WebDocument* document);
72 72
73 #if defined(ENABLE_LANGUAGE_DETECTION)
73 // Returns the ISO 639_1 language code of the specified |text|, or 'unknown' 74 // Returns the ISO 639_1 language code of the specified |text|, or 'unknown'
74 // if it failed. 75 // if it failed.
75 static std::string DetermineTextLanguage(const string16& text); 76 static std::string DetermineTextLanguage(const string16& text);
77 #endif
76 78
77 // RenderViewObserver implementation. 79 // RenderViewObserver implementation.
78 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 80 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
79 81
80 // Cancels any translation that is currently being performed. This does not 82 // Cancels any translation that is currently being performed. This does not
81 // revert existing translations. 83 // revert existing translations.
82 void CancelPendingTranslation(); 84 void CancelPendingTranslation();
83 85
84 // Checks if the current running page translation is finished or errored and 86 // Checks if the current running page translation is finished or errored and
85 // notifies the browser accordingly. If the translation has not terminated, 87 // notifies the browser accordingly. If the translation has not terminated,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 std::string source_lang_; 124 std::string source_lang_;
123 std::string target_lang_; 125 std::string target_lang_;
124 126
125 // Method factory used to make calls to TranslatePageImpl. 127 // Method factory used to make calls to TranslatePageImpl.
126 base::WeakPtrFactory<TranslateHelper> weak_method_factory_; 128 base::WeakPtrFactory<TranslateHelper> weak_method_factory_;
127 129
128 DISALLOW_COPY_AND_ASSIGN(TranslateHelper); 130 DISALLOW_COPY_AND_ASSIGN(TranslateHelper);
129 }; 131 };
130 132
131 #endif // CHROME_RENDERER_TRANSLATE_HELPER_H_ 133 #endif // CHROME_RENDERER_TRANSLATE_HELPER_H_
OLDNEW
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/renderer/translate_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698