Chromium Code Reviews| Index: content/browser/renderer_host/render_view_host.cc |
| diff --git a/content/browser/renderer_host/render_view_host.cc b/content/browser/renderer_host/render_view_host.cc |
| index d7526b6c76f4f3024109c0ca2788e6114da6f1fe..af7823abd2ad21c0bf1dd7f6aec48408a3d1e2a0 100644 |
| --- a/content/browser/renderer_host/render_view_host.cc |
| +++ b/content/browser/renderer_host/render_view_host.cc |
| @@ -56,13 +56,26 @@ using WebKit::WebDragOperationNone; |
| using WebKit::WebDragOperationsMask; |
| using WebKit::WebInputEvent; |
| using WebKit::WebMediaPlayerAction; |
| -using WebKit::WebTextDirection; |
| namespace { |
| // Delay to wait on closing the tab for a beforeunload/unload handler to fire. |
| const int kUnloadTimeoutMS = 1000; |
| +// Translate a WebKit text direction into a base::i18n one. |
| +base::i18n::TextDirection WebTextDirectionToChromeTextDirection( |
| + WebKit::WebTextDirection dir) { |
| + switch (dir) { |
| + case WebKit::WebTextDirectionLeftToRight: |
| + return base::i18n::LEFT_TO_RIGHT; |
| + case WebKit::WebTextDirectionRightToLeft: |
| + return base::i18n::LEFT_TO_RIGHT; |
|
jeremy
2011/08/02 09:34:37
I think you mean RIGHT_TO_LEFT
|
| + default: |
| + NOTREACHED(); |
| + return base::i18n::UNKNOWN_DIRECTION; |
| + } |
| +} |
| + |
| } // namespace |
| /////////////////////////////////////////////////////////////////////////////// |
| @@ -882,13 +895,18 @@ void RenderViewHost::OnMsgUpdateState(int32 page_id, |
| delegate_->UpdateState(this, page_id, state); |
| } |
| -void RenderViewHost::OnMsgUpdateTitle(int32 page_id, |
| - const string16& title) { |
| +void RenderViewHost::OnMsgUpdateTitle( |
| + int32 page_id, |
| + const string16& title, |
| + WebKit::WebTextDirection title_direction) { |
| if (title.length() > content::kMaxTitleChars) { |
| NOTREACHED() << "Renderer sent too many characters in title."; |
| return; |
| } |
| - delegate_->UpdateTitle(this, page_id, title); |
| + |
| + delegate_->UpdateTitle(this, page_id, title, |
| + WebTextDirectionToChromeTextDirection( |
| + title_direction)); |
| } |
| void RenderViewHost::OnMsgUpdateEncoding(const std::string& encoding_name) { |