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

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

Issue 6750018: Cleanup: Stop creating RenderViewObservers from chrome/ in RenderViewer. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_H_ 5 #ifndef CONTENT_RENDERER_RENDER_VIEW_H_
6 #define CONTENT_RENDERER_RENDER_VIEW_H_ 6 #define CONTENT_RENDERER_RENDER_VIEW_H_
7 #pragma once 7 #pragma once
8 8
9 #include <deque> 9 #include <deque>
10 #include <map> 10 #include <map>
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #include "webkit/plugins/npapi/webplugin_page_delegate.h" 47 #include "webkit/plugins/npapi/webplugin_page_delegate.h"
48 48
49 #if defined(OS_WIN) 49 #if defined(OS_WIN)
50 // RenderView is a diamond-shaped hierarchy, with WebWidgetClient at the root. 50 // RenderView is a diamond-shaped hierarchy, with WebWidgetClient at the root.
51 // VS warns when we inherit the WebWidgetClient method implementations from 51 // VS warns when we inherit the WebWidgetClient method implementations from
52 // RenderWidget. It's safe to ignore that warning. 52 // RenderWidget. It's safe to ignore that warning.
53 #pragma warning(disable: 4250) 53 #pragma warning(disable: 4250)
54 #endif 54 #endif
55 55
56 class AudioMessageFilter; 56 class AudioMessageFilter;
57 class BlockedPlugin;
58 class DeviceOrientationDispatcher; 57 class DeviceOrientationDispatcher;
59 class DevToolsAgent;
60 class DevToolsClient;
61 class DomAutomationController; 58 class DomAutomationController;
62 class ExternalHostBindings; 59 class ExternalHostBindings;
63 class ExternalPopupMenu; 60 class ExternalPopupMenu;
64 class FilePath; 61 class FilePath;
65 class GeolocationDispatcher; 62 class GeolocationDispatcher;
66 class GURL; 63 class GURL;
67 class LoadProgressTracker; 64 class LoadProgressTracker;
68 class NavigationState; 65 class NavigationState;
69 class NotificationProvider; 66 class NotificationProvider;
70 class P2PSocketDispatcher; 67 class P2PSocketDispatcher;
71 class PepperDeviceTest; 68 class PepperDeviceTest;
72 class PrintWebViewHelper; 69 class PrintWebViewHelper;
73 class RenderViewObserver; 70 class RenderViewObserver;
74 class RenderViewVisitor; 71 class RenderViewVisitor;
75 class SearchBox;
76 class SkBitmap; 72 class SkBitmap;
77 class SpeechInputDispatcher; 73 class SpeechInputDispatcher;
78 class SpellCheckProvider; 74 class SpellCheckProvider;
79 class WebPluginDelegatePepper; 75 class WebPluginDelegatePepper;
80 class WebPluginDelegateProxy; 76 class WebPluginDelegateProxy;
81 class WebUIBindings; 77 class WebUIBindings;
82 struct ContextMenuMediaParams; 78 struct ContextMenuMediaParams;
83 struct PP_Flash_NetAddress; 79 struct PP_Flash_NetAddress;
84 struct ThumbnailScore; 80 struct ThumbnailScore;
85 struct ViewHostMsg_RunFileChooser_Params; 81 struct ViewHostMsg_RunFileChooser_Params;
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 } 233 }
238 234
239 // Returns true if we should display scrollbars for the given view size and 235 // Returns true if we should display scrollbars for the given view size and
240 // false if the scrollbars should be hidden. 236 // false if the scrollbars should be hidden.
241 bool should_display_scrollbars(int width, int height) const { 237 bool should_display_scrollbars(int width, int height) const {
242 return (!send_preferred_size_changes_ || 238 return (!send_preferred_size_changes_ ||
243 (disable_scrollbars_size_limit_.width() <= width || 239 (disable_scrollbars_size_limit_.width() <= width ||
244 disable_scrollbars_size_limit_.height() <= height)); 240 disable_scrollbars_size_limit_.height() <= height));
245 } 241 }
246 242
247 SearchBox* searchbox() const { return searchbox_; }
248
249 const WebKit::WebNode& context_menu_node() { return context_menu_node_; } 243 const WebKit::WebNode& context_menu_node() { return context_menu_node_; }
250 244
251 // Current P2PSocketDispatcher. Set to NULL if P2P API is disabled. 245 // Current P2PSocketDispatcher. Set to NULL if P2P API is disabled.
252 P2PSocketDispatcher* p2p_socket_dispatcher() { 246 P2PSocketDispatcher* p2p_socket_dispatcher() {
253 return p2p_socket_dispatcher_; 247 return p2p_socket_dispatcher_;
254 } 248 }
255 249
256 // Functions to add and remove observers for this object. 250 // Functions to add and remove observers for this object.
257 void AddObserver(RenderViewObserver* observer); 251 void AddObserver(RenderViewObserver* observer);
258 void RemoveObserver(RenderViewObserver* observer); 252 void RemoveObserver(RenderViewObserver* observer);
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 friend class chrome::ChromeContentRendererClient; 625 friend class chrome::ChromeContentRendererClient;
632 626
633 // For unit tests. 627 // For unit tests.
634 friend class ExternalPopupMenuTest; 628 friend class ExternalPopupMenuTest;
635 friend class PepperDeviceTest; 629 friend class PepperDeviceTest;
636 friend class RenderViewTest; 630 friend class RenderViewTest;
637 631
638 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange); 632 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange);
639 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, NormalCase); 633 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, NormalCase);
640 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, ShowPopupThenNavigate); 634 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, ShowPopupThenNavigate);
641 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, BlockScriptInitiatedPrinting);
642 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, ImeComposition); 635 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, ImeComposition);
643 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, InsertCharacters); 636 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, InsertCharacters);
644 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, JSBlockSentAfterPageLoad); 637 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, JSBlockSentAfterPageLoad);
645 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, LastCommittedUpdateState); 638 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, LastCommittedUpdateState);
646 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, OnHandleKeyboardEvent); 639 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, OnHandleKeyboardEvent);
647 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, OnImeStateChanged); 640 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, OnImeStateChanged);
648 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, OnNavStateChanged); 641 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, OnNavStateChanged);
649 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, OnPrintPages);
650 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, OnSetTextDirection); 642 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, OnSetTextDirection);
651 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, PrintLayoutTest);
652 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, PrintWithIframe);
653 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, UpdateTargetURLWithInvalidURL); 643 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, UpdateTargetURLWithInvalidURL);
654 #if defined(OS_MACOSX) 644 #if defined(OS_MACOSX)
655 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, MacTestCmdUp); 645 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, MacTestCmdUp);
656 #endif 646 #endif
657 647
658 typedef std::map<GURL, ContentSettings> HostContentSettings; 648 typedef std::map<GURL, ContentSettings> HostContentSettings;
659 typedef std::map<GURL, double> HostZoomLevels; 649 typedef std::map<GURL, double> HostZoomLevels;
660 650
661 // Cannot use std::set unfortunately since linked_ptr<> does not support 651 // Cannot use std::set unfortunately since linked_ptr<> does not support
662 // operator<. 652 // operator<.
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 1220
1231 // The geolocation dispatcher attached to this view, lazily initialized. 1221 // The geolocation dispatcher attached to this view, lazily initialized.
1232 GeolocationDispatcher* geolocation_dispatcher_; 1222 GeolocationDispatcher* geolocation_dispatcher_;
1233 1223
1234 // The speech dispatcher attached to this view, lazily initialized. 1224 // The speech dispatcher attached to this view, lazily initialized.
1235 SpeechInputDispatcher* speech_input_dispatcher_; 1225 SpeechInputDispatcher* speech_input_dispatcher_;
1236 1226
1237 // Device orientation dispatcher attached to this view; lazily initialized. 1227 // Device orientation dispatcher attached to this view; lazily initialized.
1238 DeviceOrientationDispatcher* device_orientation_dispatcher_; 1228 DeviceOrientationDispatcher* device_orientation_dispatcher_;
1239 1229
1240 // PrintWebViewHelper handles printing
1241 PrintWebViewHelper* print_helper_;
1242
1243 SearchBox* searchbox_;
1244
1245 // spellcheck provider which is registered as a view observer. 1230 // spellcheck provider which is registered as a view observer.
1246 SpellCheckProvider* spellcheck_provider_; 1231 SpellCheckProvider* spellcheck_provider_;
1247 1232
1248 scoped_refptr<AudioMessageFilter> audio_message_filter_; 1233 scoped_refptr<AudioMessageFilter> audio_message_filter_;
1249 1234
1250 // Handles accessibility requests into the renderer side, as well as 1235 // Handles accessibility requests into the renderer side, as well as
1251 // maintains the cache and other features of the accessibility tree. 1236 // maintains the cache and other features of the accessibility tree.
1252 scoped_ptr<WebKit::WebAccessibilityCache> accessibility_; 1237 scoped_ptr<WebKit::WebAccessibilityCache> accessibility_;
1253 1238
1254 // Collect renderer accessibility notifications until they are ready to be 1239 // Collect renderer accessibility notifications until they are ready to be
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
1346 // bunch of stuff, you should probably create a helper class and put your 1331 // bunch of stuff, you should probably create a helper class and put your
1347 // data and methods on that to avoid bloating RenderView more. You can use 1332 // data and methods on that to avoid bloating RenderView more. You can use
1348 // the Observer interface to filter IPC messages and receive frame change 1333 // the Observer interface to filter IPC messages and receive frame change
1349 // notifications. 1334 // notifications.
1350 // --------------------------------------------------------------------------- 1335 // ---------------------------------------------------------------------------
1351 1336
1352 DISALLOW_COPY_AND_ASSIGN(RenderView); 1337 DISALLOW_COPY_AND_ASSIGN(RenderView);
1353 }; 1338 };
1354 1339
1355 #endif // CONTENT_RENDERER_RENDER_VIEW_H_ 1340 #endif // CONTENT_RENDERER_RENDER_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698