OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <deque> | 11 #include <deque> |
12 #include <map> | 12 #include <map> |
| 13 #include <memory> |
13 #include <set> | 14 #include <set> |
14 #include <string> | 15 #include <string> |
15 #include <vector> | 16 #include <vector> |
16 | 17 |
17 #include "base/gtest_prod_util.h" | 18 #include "base/gtest_prod_util.h" |
18 #include "base/id_map.h" | 19 #include "base/id_map.h" |
19 #include "base/macros.h" | 20 #include "base/macros.h" |
20 #include "base/memory/scoped_ptr.h" | |
21 #include "base/memory/weak_ptr.h" | 21 #include "base/memory/weak_ptr.h" |
22 #include "base/observer_list.h" | 22 #include "base/observer_list.h" |
23 #include "base/process/process.h" | 23 #include "base/process/process.h" |
24 #include "base/strings/string16.h" | 24 #include "base/strings/string16.h" |
25 #include "base/timer/timer.h" | 25 #include "base/timer/timer.h" |
26 #include "build/build_config.h" | 26 #include "build/build_config.h" |
27 #include "cc/input/top_controls_state.h" | 27 #include "cc/input/top_controls_state.h" |
28 #include "cc/resources/shared_bitmap.h" | 28 #include "cc/resources/shared_bitmap.h" |
29 #include "content/common/content_export.h" | 29 #include "content/common/content_export.h" |
30 #include "content/common/drag_event_source_info.h" | 30 #include "content/common/drag_event_source_info.h" |
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
884 // along with the RenderView automatically. This is why we just store | 884 // along with the RenderView automatically. This is why we just store |
885 // weak references. | 885 // weak references. |
886 | 886 |
887 // The speech recognition dispatcher attached to this view, lazily | 887 // The speech recognition dispatcher attached to this view, lazily |
888 // initialized. | 888 // initialized. |
889 SpeechRecognitionDispatcher* speech_recognition_dispatcher_; | 889 SpeechRecognitionDispatcher* speech_recognition_dispatcher_; |
890 | 890 |
891 // Mouse Lock dispatcher attached to this view. | 891 // Mouse Lock dispatcher attached to this view. |
892 MouseLockDispatcher* mouse_lock_dispatcher_; | 892 MouseLockDispatcher* mouse_lock_dispatcher_; |
893 | 893 |
894 scoped_ptr<HistoryController> history_controller_; | 894 std::unique_ptr<HistoryController> history_controller_; |
895 | 895 |
896 #if defined(OS_ANDROID) | 896 #if defined(OS_ANDROID) |
897 // Android Specific --------------------------------------------------------- | 897 // Android Specific --------------------------------------------------------- |
898 | 898 |
899 // Expected id of the next content intent launched. Used to prevent scheduled | 899 // Expected id of the next content intent launched. Used to prevent scheduled |
900 // intents to be launched if aborted. | 900 // intents to be launched if aborted. |
901 size_t expected_content_intent_id_; | 901 size_t expected_content_intent_id_; |
902 | 902 |
903 // List of click-based content detectors. | 903 // List of click-based content detectors. |
904 std::vector<scoped_ptr<ContentDetector>> content_detectors_; | 904 std::vector<std::unique_ptr<ContentDetector>> content_detectors_; |
905 | 905 |
906 // A date/time picker object for date and time related input elements. | 906 // A date/time picker object for date and time related input elements. |
907 scoped_ptr<RendererDateTimePicker> date_time_picker_client_; | 907 std::unique_ptr<RendererDateTimePicker> date_time_picker_client_; |
908 #endif | 908 #endif |
909 | 909 |
910 // Plugins ------------------------------------------------------------------- | 910 // Plugins ------------------------------------------------------------------- |
911 #if defined(ENABLE_PLUGINS) | 911 #if defined(ENABLE_PLUGINS) |
912 typedef std::set<PepperPluginInstanceImpl*> PepperPluginSet; | 912 typedef std::set<PepperPluginInstanceImpl*> PepperPluginSet; |
913 PepperPluginSet active_pepper_instances_; | 913 PepperPluginSet active_pepper_instances_; |
914 | 914 |
915 // TODO(jam): these belong on RenderFrame, once the browser knows which frame | 915 // TODO(jam): these belong on RenderFrame, once the browser knows which frame |
916 // is focused and sends the IPCs which use these to the correct frame. Until | 916 // is focused and sends the IPCs which use these to the correct frame. Until |
917 // then, we must store these on RenderView as that's the one place that knows | 917 // then, we must store these on RenderView as that's the one place that knows |
918 // about all the RenderFrames for a page. | 918 // about all the RenderFrames for a page. |
919 | 919 |
920 // Whether or not the focus is on a PPAPI plugin | 920 // Whether or not the focus is on a PPAPI plugin |
921 PepperPluginInstanceImpl* focused_pepper_plugin_; | 921 PepperPluginInstanceImpl* focused_pepper_plugin_; |
922 | 922 |
923 // The plugin instance that received the last mouse event. It is set to NULL | 923 // The plugin instance that received the last mouse event. It is set to NULL |
924 // if the last mouse event went to elements other than Pepper plugins. | 924 // if the last mouse event went to elements other than Pepper plugins. |
925 // |pepper_last_mouse_event_target_| is not owned by this class. We depend on | 925 // |pepper_last_mouse_event_target_| is not owned by this class. We depend on |
926 // the RenderFrameImpl to NULL it out when it destructs. | 926 // the RenderFrameImpl to NULL it out when it destructs. |
927 PepperPluginInstanceImpl* pepper_last_mouse_event_target_; | 927 PepperPluginInstanceImpl* pepper_last_mouse_event_target_; |
928 #endif | 928 #endif |
929 | 929 |
930 // Misc ---------------------------------------------------------------------- | 930 // Misc ---------------------------------------------------------------------- |
931 | 931 |
932 // The current and pending file chooser completion objects. If the queue is | 932 // The current and pending file chooser completion objects. If the queue is |
933 // nonempty, the first item represents the currently running file chooser | 933 // nonempty, the first item represents the currently running file chooser |
934 // callback, and the remaining elements are the other file chooser completion | 934 // callback, and the remaining elements are the other file chooser completion |
935 // still waiting to be run (in order). | 935 // still waiting to be run (in order). |
936 struct PendingFileChooser; | 936 struct PendingFileChooser; |
937 std::deque<scoped_ptr<PendingFileChooser>> file_chooser_completions_; | 937 std::deque<std::unique_ptr<PendingFileChooser>> file_chooser_completions_; |
938 | 938 |
939 // The current directory enumeration callback | 939 // The current directory enumeration callback |
940 std::map<int, blink::WebFileChooserCompletion*> enumeration_completions_; | 940 std::map<int, blink::WebFileChooserCompletion*> enumeration_completions_; |
941 int enumeration_completion_id_; | 941 int enumeration_completion_id_; |
942 | 942 |
943 // The SessionStorage namespace that we're assigned to has an ID, and that ID | 943 // The SessionStorage namespace that we're assigned to has an ID, and that ID |
944 // is passed to us upon creation. WebKit asks for this ID upon first use and | 944 // is passed to us upon creation. WebKit asks for this ID upon first use and |
945 // uses it whenever asking the browser process to allocate new storage areas. | 945 // uses it whenever asking the browser process to allocate new storage areas. |
946 int64_t session_storage_namespace_id_; | 946 int64_t session_storage_namespace_id_; |
947 | 947 |
948 // Stores edit commands associated to the next key event. | 948 // Stores edit commands associated to the next key event. |
949 // Shall be cleared as soon as the next key event is processed. | 949 // Shall be cleared as soon as the next key event is processed. |
950 EditCommands edit_commands_; | 950 EditCommands edit_commands_; |
951 | 951 |
952 // All the registered observers. We expect this list to be small, so vector | 952 // All the registered observers. We expect this list to be small, so vector |
953 // is fine. | 953 // is fine. |
954 base::ObserverList<RenderViewObserver> observers_; | 954 base::ObserverList<RenderViewObserver> observers_; |
955 | 955 |
956 // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface. | 956 // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface. |
957 scoped_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_; | 957 std::unique_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_; |
958 | 958 |
959 // This field stores drag/drop related info for the event that is currently | 959 // This field stores drag/drop related info for the event that is currently |
960 // being handled. If the current event results in starting a drag/drop | 960 // being handled. If the current event results in starting a drag/drop |
961 // session, this info is sent to the browser along with other drag/drop info. | 961 // session, this info is sent to the browser along with other drag/drop info. |
962 DragEventSourceInfo possible_drag_event_info_; | 962 DragEventSourceInfo possible_drag_event_info_; |
963 | 963 |
964 // NOTE: stats_collection_observer_ should be the last members because their | 964 // NOTE: stats_collection_observer_ should be the last members because their |
965 // constructors call the AddObservers method of RenderViewImpl. | 965 // constructors call the AddObservers method of RenderViewImpl. |
966 scoped_ptr<StatsCollectionObserver> stats_collection_observer_; | 966 std::unique_ptr<StatsCollectionObserver> stats_collection_observer_; |
967 | 967 |
968 typedef std::map<cc::SharedBitmapId, cc::SharedBitmap*> BitmapMap; | 968 typedef std::map<cc::SharedBitmapId, cc::SharedBitmap*> BitmapMap; |
969 BitmapMap disambiguation_bitmaps_; | 969 BitmapMap disambiguation_bitmaps_; |
970 | 970 |
971 // --------------------------------------------------------------------------- | 971 // --------------------------------------------------------------------------- |
972 // ADDING NEW DATA? Please see if it fits appropriately in one of the above | 972 // ADDING NEW DATA? Please see if it fits appropriately in one of the above |
973 // sections rather than throwing it randomly at the end. If you're adding a | 973 // sections rather than throwing it randomly at the end. If you're adding a |
974 // bunch of stuff, you should probably create a helper class and put your | 974 // bunch of stuff, you should probably create a helper class and put your |
975 // data and methods on that to avoid bloating RenderView more. You can | 975 // data and methods on that to avoid bloating RenderView more. You can |
976 // use the Observer interface to filter IPC messages and receive frame change | 976 // use the Observer interface to filter IPC messages and receive frame change |
977 // notifications. | 977 // notifications. |
978 // --------------------------------------------------------------------------- | 978 // --------------------------------------------------------------------------- |
979 | 979 |
980 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 980 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
981 }; | 981 }; |
982 | 982 |
983 } // namespace content | 983 } // namespace content |
984 | 984 |
985 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 985 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
OLD | NEW |