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

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

Issue 552216: This CL makes the TranslationService class send the text to be translated to ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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_RENDER_VIEW_H_ 5 #ifndef CHROME_RENDERER_RENDER_VIEW_H_
6 #define CHROME_RENDERER_RENDER_VIEW_H_ 6 #define CHROME_RENDERER_RENDER_VIEW_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 152
153 // May return NULL when the view is closing. 153 // May return NULL when the view is closing.
154 WebKit::WebView* webview() const { 154 WebKit::WebView* webview() const {
155 return static_cast<WebKit::WebView*>(webwidget()); 155 return static_cast<WebKit::WebView*>(webwidget());
156 } 156 }
157 157
158 gfx::NativeViewId host_window() const { 158 gfx::NativeViewId host_window() const {
159 return host_window_; 159 return host_window_;
160 } 160 }
161 161
162 int browser_window_id() { 162 int browser_window_id() const {
163 return browser_window_id_; 163 return browser_window_id_;
164 } 164 }
165 165
166 ViewType::Type view_type() { 166 ViewType::Type view_type() const {
167 return view_type_; 167 return view_type_;
168 } 168 }
169 169
170 PrintWebViewHelper* print_helper() { 170 PrintWebViewHelper* print_helper() const {
171 return print_helper_.get(); 171 return print_helper_.get();
172 } 172 }
173 173
174 int page_id() const {
175 return page_id_;
176 }
177
174 // IPC::Channel::Listener 178 // IPC::Channel::Listener
175 virtual void OnMessageReceived(const IPC::Message& msg); 179 virtual void OnMessageReceived(const IPC::Message& msg);
176 180
177 // WebViewDelegate 181 // WebViewDelegate
178 virtual void LoadNavigationErrorPage( 182 virtual void LoadNavigationErrorPage(
179 WebKit::WebFrame* frame, 183 WebKit::WebFrame* frame,
180 const WebKit::WebURLRequest& failed_request, 184 const WebKit::WebURLRequest& failed_request,
181 const WebKit::WebURLError& error, 185 const WebKit::WebURLError& error,
182 const std::string& html, 186 const std::string& html,
183 bool replace); 187 bool replace);
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 // a custom background. 686 // a custom background.
683 void OnSetBackground(const SkBitmap& background); 687 void OnSetBackground(const SkBitmap& background);
684 688
685 // Activate/deactivate the RenderView (i.e., set its controls' tint 689 // Activate/deactivate the RenderView (i.e., set its controls' tint
686 // accordingly, etc.). 690 // accordingly, etc.).
687 void OnSetActive(bool active); 691 void OnSetActive(bool active);
688 692
689 // Execute custom context menu action. 693 // Execute custom context menu action.
690 void OnCustomContextMenuAction(unsigned action); 694 void OnCustomContextMenuAction(unsigned action);
691 695
696 // Tells the renderer to translate the page contents.
697 void OnTranslatePage(int page_id,
698 const std::string& source_lang,
699 const std::string& target_lang);
700
692 // Message that provides the translated text for a request. 701 // Message that provides the translated text for a request.
693 void OnTranslateTextResponse(int work_id, 702 void OnTranslateTextResponse(int work_id,
694 int error_id, 703 int error_id,
695 const std::vector<string16>& text_chunks); 704 const std::vector<string16>& text_chunks);
696 705
697 // Exposes the DOMAutomationController object that allows JS to send 706 // Exposes the DOMAutomationController object that allows JS to send
698 // information to the browser process. 707 // information to the browser process.
699 void BindDOMAutomationController(WebKit::WebFrame* webframe); 708 void BindDOMAutomationController(WebKit::WebFrame* webframe);
700 709
701 // Creates DevToolsClient and sets up JavaScript bindings for developer tools 710 // Creates DevToolsClient and sets up JavaScript bindings for developer tools
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
1016 int64 session_storage_namespace_id_; 1025 int64 session_storage_namespace_id_;
1017 1026
1018 // Page translation related objects. 1027 // Page translation related objects.
1019 TextTranslatorImpl text_translator_; 1028 TextTranslatorImpl text_translator_;
1020 scoped_ptr<PageTranslator> page_translator_; 1029 scoped_ptr<PageTranslator> page_translator_;
1021 1030
1022 DISALLOW_COPY_AND_ASSIGN(RenderView); 1031 DISALLOW_COPY_AND_ASSIGN(RenderView);
1023 }; 1032 };
1024 1033
1025 #endif // CHROME_RENDERER_RENDER_VIEW_H_ 1034 #endif // CHROME_RENDERER_RENDER_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698