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

Side by Side Diff: components/translate/content/renderer/translate_helper.h

Issue 2628053003: Remove extension group from DOMWrapperWorld. (Closed)
Patch Set: Fix GCCallbackTest Created 3 years, 11 months 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
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 COMPONENTS_TRANSLATE_CONTENT_RENDERER_TRANSLATE_HELPER_H_ 5 #ifndef COMPONENTS_TRANSLATE_CONTENT_RENDERER_TRANSLATE_HELPER_H_
6 #define COMPONENTS_TRANSLATE_CONTENT_RENDERER_TRANSLATE_HELPER_H_ 6 #define COMPONENTS_TRANSLATE_CONTENT_RENDERER_TRANSLATE_HELPER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 13 matching lines...) Expand all
24 24
25 namespace translate { 25 namespace translate {
26 26
27 // This class deals with page translation. 27 // This class deals with page translation.
28 // There is one TranslateHelper per RenderView. 28 // There is one TranslateHelper per RenderView.
29 class TranslateHelper : public content::RenderFrameObserver, 29 class TranslateHelper : public content::RenderFrameObserver,
30 public mojom::Page { 30 public mojom::Page {
31 public: 31 public:
32 TranslateHelper(content::RenderFrame* render_frame, 32 TranslateHelper(content::RenderFrame* render_frame,
33 int world_id, 33 int world_id,
34 int extension_group,
35 const std::string& extension_scheme); 34 const std::string& extension_scheme);
36 ~TranslateHelper() override; 35 ~TranslateHelper() override;
37 36
38 // Informs us that the page's text has been extracted. 37 // Informs us that the page's text has been extracted.
39 void PageCaptured(const base::string16& contents); 38 void PageCaptured(const base::string16& contents);
40 39
41 // Lets the translation system know that we are preparing to navigate to 40 // Lets the translation system know that we are preparing to navigate to
42 // the specified URL. If there is anything that can or should be done before 41 // the specified URL. If there is anything that can or should be done before
43 // this URL loads, this is the time to prepare for it. 42 // this URL loads, this is the time to prepare for it.
44 void PrepareForUrl(const GURL& url); 43 void PrepareForUrl(const GURL& url);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 std::string source_lang_; 137 std::string source_lang_;
139 std::string target_lang_; 138 std::string target_lang_;
140 139
141 // Time when a page langauge is determined. This is used to know a duration 140 // Time when a page langauge is determined. This is used to know a duration
142 // time from showing infobar to requesting translation. 141 // time from showing infobar to requesting translation.
143 base::TimeTicks language_determined_time_; 142 base::TimeTicks language_determined_time_;
144 143
145 // The world ID to use for script execution. 144 // The world ID to use for script execution.
146 int world_id_; 145 int world_id_;
147 146
148 // The extension group.
149 int extension_group_;
150
151 // The URL scheme for translate extensions. 147 // The URL scheme for translate extensions.
152 std::string extension_scheme_; 148 std::string extension_scheme_;
153 149
154 mojom::ContentTranslateDriverPtr translate_driver_; 150 mojom::ContentTranslateDriverPtr translate_driver_;
155 151
156 mojo::Binding<mojom::Page> binding_; 152 mojo::Binding<mojom::Page> binding_;
157 153
158 // Method factory used to make calls to TranslatePageImpl. 154 // Method factory used to make calls to TranslatePageImpl.
159 base::WeakPtrFactory<TranslateHelper> weak_method_factory_; 155 base::WeakPtrFactory<TranslateHelper> weak_method_factory_;
160 156
161 DISALLOW_COPY_AND_ASSIGN(TranslateHelper); 157 DISALLOW_COPY_AND_ASSIGN(TranslateHelper);
162 }; 158 };
163 159
164 } // namespace translate 160 } // namespace translate
165 161
166 #endif // COMPONENTS_TRANSLATE_CONTENT_RENDERER_TRANSLATE_HELPER_H_ 162 #endif // COMPONENTS_TRANSLATE_CONTENT_RENDERER_TRANSLATE_HELPER_H_
OLDNEW
« no previous file with comments | « components/test_runner/test_runner_for_specific_view.cc ('k') | components/translate/content/renderer/translate_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698