OLD | NEW |
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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 | 429 |
430 // Sends a message and runs a nested message loop. | 430 // Sends a message and runs a nested message loop. |
431 bool SendAndRunNestedMessageLoop(IPC::SyncMessage* message); | 431 bool SendAndRunNestedMessageLoop(IPC::SyncMessage* message); |
432 | 432 |
433 // Called when the "idle" user script state has been reached. See | 433 // Called when the "idle" user script state has been reached. See |
434 // UserScript::DOCUMENT_IDLE. | 434 // UserScript::DOCUMENT_IDLE. |
435 void OnUserScriptIdleTriggered(WebKit::WebFrame* frame); | 435 void OnUserScriptIdleTriggered(WebKit::WebFrame* frame); |
436 | 436 |
437 PageTranslator* page_translator() const { return page_translator_.get(); } | 437 PageTranslator* page_translator() const { return page_translator_.get(); } |
438 | 438 |
439 // Returns the ISO 639 language code of the current page (e.g. en, fr, zh). | 439 // Returns the ISO 639_1 language code of the current page |
440 // If ISO 639-1 code is not available for the language, ISO 639-2 3-letter cod
e | 440 // (ex: en, fr, zh...). Returns 'unknown' if the language could not be |
441 // will be returned (e.g. kha for Khasi and und for undtermined). For traditio
nal | 441 // determined. |
442 // Chinse, 'zh-TW' will be returned while for simplified Chinse, 'zh' will be | |
443 // returned. | |
444 // TODO(jungshik): Make it return 'he' (the correct ISO 639 code for Hebrew) | |
445 // instead of the obsolete 'iw'. Perhaps, it's also better to return 'zh-Hans' | |
446 // (or 'zh-CN') for Simplified Chinese instead of 'zh' to be aligned with | |
447 // 'zh-TW' for Traditional Chinse. | |
448 std::string DetectLanguage(); | 442 std::string DetectLanguage(); |
449 | 443 |
450 protected: | 444 protected: |
451 // RenderWidget overrides: | 445 // RenderWidget overrides: |
452 virtual void Close(); | 446 virtual void Close(); |
453 virtual void OnResize(const gfx::Size& new_size, | 447 virtual void OnResize(const gfx::Size& new_size, |
454 const gfx::Rect& resizer_rect); | 448 const gfx::Rect& resizer_rect); |
455 virtual void DidPaint(); | 449 virtual void DidPaint(); |
456 virtual void DidHandleKeyEvent(); | 450 virtual void DidHandleKeyEvent(); |
457 | 451 |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 int64 session_storage_namespace_id_; | 1013 int64 session_storage_namespace_id_; |
1020 | 1014 |
1021 // Page translation related objects. | 1015 // Page translation related objects. |
1022 TextTranslatorImpl text_translator_; | 1016 TextTranslatorImpl text_translator_; |
1023 scoped_ptr<PageTranslator> page_translator_; | 1017 scoped_ptr<PageTranslator> page_translator_; |
1024 | 1018 |
1025 DISALLOW_COPY_AND_ASSIGN(RenderView); | 1019 DISALLOW_COPY_AND_ASSIGN(RenderView); |
1026 }; | 1020 }; |
1027 | 1021 |
1028 #endif // CHROME_RENDERER_RENDER_VIEW_H_ | 1022 #endif // CHROME_RENDERER_RENDER_VIEW_H_ |
OLD | NEW |