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> |
11 #include <queue> | 11 #include <queue> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
15 #include "base/file_path.h" | 15 #include "base/file_path.h" |
16 #include "base/gfx/point.h" | 16 #include "base/gfx/point.h" |
17 #include "base/gfx/rect.h" | 17 #include "base/gfx/rect.h" |
18 #include "base/id_map.h" | 18 #include "base/id_map.h" |
19 #include "base/shared_memory.h" | 19 #include "base/shared_memory.h" |
20 #include "base/timer.h" | 20 #include "base/timer.h" |
21 #include "base/values.h" | 21 #include "base/values.h" |
22 #include "base/weak_ptr.h" | 22 #include "base/weak_ptr.h" |
23 #include "build/build_config.h" | 23 #include "build/build_config.h" |
24 #include "chrome/common/edit_command.h" | 24 #include "chrome/common/edit_command.h" |
25 #include "chrome/common/navigation_gesture.h" | 25 #include "chrome/common/navigation_gesture.h" |
26 #include "chrome/common/notification_type.h" | 26 #include "chrome/common/notification_type.h" |
| 27 #include "chrome/common/page_zoom.h" |
27 #include "chrome/common/renderer_preferences.h" | 28 #include "chrome/common/renderer_preferences.h" |
28 #include "chrome/common/view_types.h" | 29 #include "chrome/common/view_types.h" |
29 #include "chrome/renderer/automation/dom_automation_controller.h" | 30 #include "chrome/renderer/automation/dom_automation_controller.h" |
30 #include "chrome/renderer/dom_ui_bindings.h" | 31 #include "chrome/renderer/dom_ui_bindings.h" |
31 #include "chrome/renderer/extensions/extension_process_bindings.h" | 32 #include "chrome/renderer/extensions/extension_process_bindings.h" |
32 #include "chrome/renderer/external_host_bindings.h" | 33 #include "chrome/renderer/external_host_bindings.h" |
33 #include "chrome/renderer/notification_provider.h" | 34 #include "chrome/renderer/notification_provider.h" |
34 #include "chrome/renderer/render_widget.h" | 35 #include "chrome/renderer/render_widget.h" |
35 #include "chrome/renderer/render_view_visitor.h" | 36 #include "chrome/renderer/render_view_visitor.h" |
36 #include "third_party/skia/include/core/SkBitmap.h" | 37 #include "third_party/skia/include/core/SkBitmap.h" |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 FRIEND_TEST(RenderViewTest, OnSetTextDirection); | 445 FRIEND_TEST(RenderViewTest, OnSetTextDirection); |
445 FRIEND_TEST(RenderViewTest, OnPrintPages); | 446 FRIEND_TEST(RenderViewTest, OnPrintPages); |
446 FRIEND_TEST(RenderViewTest, PrintWithIframe); | 447 FRIEND_TEST(RenderViewTest, PrintWithIframe); |
447 FRIEND_TEST(RenderViewTest, PrintLayoutTest); | 448 FRIEND_TEST(RenderViewTest, PrintLayoutTest); |
448 FRIEND_TEST(RenderViewTest, OnHandleKeyboardEvent); | 449 FRIEND_TEST(RenderViewTest, OnHandleKeyboardEvent); |
449 FRIEND_TEST(RenderViewTest, InsertCharacters); | 450 FRIEND_TEST(RenderViewTest, InsertCharacters); |
450 #if defined(OS_MACOSX) | 451 #if defined(OS_MACOSX) |
451 FRIEND_TEST(RenderViewTest, MacTestCmdUp); | 452 FRIEND_TEST(RenderViewTest, MacTestCmdUp); |
452 #endif | 453 #endif |
453 | 454 |
| 455 typedef std::map<std::string, int> HostZoomLevels; |
| 456 |
454 explicit RenderView(RenderThreadBase* render_thread, | 457 explicit RenderView(RenderThreadBase* render_thread, |
455 const WebPreferences& webkit_preferences); | 458 const WebPreferences& webkit_preferences); |
456 | 459 |
457 // Initializes this view with the given parent and ID. The |routing_id| can be | 460 // Initializes this view with the given parent and ID. The |routing_id| can be |
458 // set to 'MSG_ROUTING_NONE' if the true ID is not yet known. In this case, | 461 // set to 'MSG_ROUTING_NONE' if the true ID is not yet known. In this case, |
459 // CompleteInit must be called later with the true ID. | 462 // CompleteInit must be called later with the true ID. |
460 void Init(gfx::NativeViewId parent, | 463 void Init(gfx::NativeViewId parent, |
461 int32 opener_id, | 464 int32 opener_id, |
462 const RendererPreferences& renderer_prefs, | 465 const RendererPreferences& renderer_prefs, |
463 SharedRenderViewCounter* counter, | 466 SharedRenderViewCounter* counter, |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 void OnToggleSpellCheck(); | 548 void OnToggleSpellCheck(); |
546 void OnDelete(); | 549 void OnDelete(); |
547 void OnSelectAll(); | 550 void OnSelectAll(); |
548 void OnCopyImageAt(int x, int y); | 551 void OnCopyImageAt(int x, int y); |
549 void OnExecuteEditCommand(const std::string& name, const std::string& value); | 552 void OnExecuteEditCommand(const std::string& name, const std::string& value); |
550 void OnSetEditCommandsForNextKeyEvent(const EditCommands& edit_commands); | 553 void OnSetEditCommandsForNextKeyEvent(const EditCommands& edit_commands); |
551 void OnSetupDevToolsClient(); | 554 void OnSetupDevToolsClient(); |
552 void OnCancelDownload(int32 download_id); | 555 void OnCancelDownload(int32 download_id); |
553 void OnFind(int request_id, const string16&, const WebKit::WebFindOptions&); | 556 void OnFind(int request_id, const string16&, const WebKit::WebFindOptions&); |
554 void OnDeterminePageText(); | 557 void OnDeterminePageText(); |
555 void OnZoom(int function); | 558 void OnZoom(PageZoom::Function function); |
| 559 void OnSetZoomLevelForLoadingHost(std::string host, int zoom_level); |
556 void OnSetPageEncoding(const std::string& encoding_name); | 560 void OnSetPageEncoding(const std::string& encoding_name); |
557 void OnResetPageEncodingToDefault(); | 561 void OnResetPageEncodingToDefault(); |
558 void OnGetAllSavableResourceLinksForCurrentPage(const GURL& page_url); | 562 void OnGetAllSavableResourceLinksForCurrentPage(const GURL& page_url); |
559 void OnGetSerializedHtmlDataForCurrentPageWithLocalLinks( | 563 void OnGetSerializedHtmlDataForCurrentPageWithLocalLinks( |
560 const std::vector<GURL>& links, | 564 const std::vector<GURL>& links, |
561 const std::vector<FilePath>& local_paths, | 565 const std::vector<FilePath>& local_paths, |
562 const FilePath& local_directory_name); | 566 const FilePath& local_directory_name); |
563 void OnFormFill(const FormData& form); | 567 void OnFormFill(const FormData& form); |
564 void OnFillPasswordForm( | 568 void OnFillPasswordForm( |
565 const webkit_glue::PasswordFormDomManager::FillData& form_data); | 569 const webkit_glue::PasswordFormDomManager::FillData& form_data); |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 // Stores edit commands associated to the next key event. | 1004 // Stores edit commands associated to the next key event. |
1001 // Shall be cleared as soon as the next key event is processed. | 1005 // Shall be cleared as soon as the next key event is processed. |
1002 EditCommands edit_commands_; | 1006 EditCommands edit_commands_; |
1003 | 1007 |
1004 // ImageResourceFetchers schedule via DownloadImage. | 1008 // ImageResourceFetchers schedule via DownloadImage. |
1005 typedef std::set<webkit_glue::ImageResourceFetcher*> ImageResourceFetcherSet; | 1009 typedef std::set<webkit_glue::ImageResourceFetcher*> ImageResourceFetcherSet; |
1006 ImageResourceFetcherSet image_fetchers_; | 1010 ImageResourceFetcherSet image_fetchers_; |
1007 | 1011 |
1008 typedef std::map<WebKit::WebView*, RenderView*> ViewMap; | 1012 typedef std::map<WebKit::WebView*, RenderView*> ViewMap; |
1009 | 1013 |
| 1014 HostZoomLevels host_zoom_levels_; |
| 1015 |
1010 DISALLOW_COPY_AND_ASSIGN(RenderView); | 1016 DISALLOW_COPY_AND_ASSIGN(RenderView); |
1011 }; | 1017 }; |
1012 | 1018 |
1013 #endif // CHROME_RENDERER_RENDER_VIEW_H_ | 1019 #endif // CHROME_RENDERER_RENDER_VIEW_H_ |
OLD | NEW |