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

Side by Side Diff: public/web/WebFrame.h

Issue 232133004: Split WebLocalFrame into a distinct subclass of WebFrame. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix Mac Created 6 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
« no previous file with comments | « Source/web/tests/WebHelperPluginTest.cpp ('k') | public/web/WebLocalFrame.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 namespace blink { 56 namespace blink {
57 57
58 class WebData; 58 class WebData;
59 class WebDataSource; 59 class WebDataSource;
60 class WebDocument; 60 class WebDocument;
61 class WebElement; 61 class WebElement;
62 class WebFormElement; 62 class WebFormElement;
63 class WebFrameClient; 63 class WebFrameClient;
64 class WebInputElement; 64 class WebInputElement;
65 class WebLayer; 65 class WebLayer;
66 class WebLocalFrame;
66 class WebPerformance; 67 class WebPerformance;
67 class WebPermissionClient; 68 class WebPermissionClient;
68 class WebRange; 69 class WebRange;
69 class WebSecurityOrigin; 70 class WebSecurityOrigin;
70 class WebSharedWorkerRepositoryClient; 71 class WebSharedWorkerRepositoryClient;
71 class WebString; 72 class WebString;
72 class WebURL; 73 class WebURL;
73 class WebURLLoader; 74 class WebURLLoader;
74 class WebURLRequest; 75 class WebURLRequest;
75 class WebView; 76 class WebView;
76 struct WebConsoleMessage; 77 struct WebConsoleMessage;
77 struct WebFindOptions; 78 struct WebFindOptions;
78 struct WebFloatPoint; 79 struct WebFloatPoint;
79 struct WebFloatRect; 80 struct WebFloatRect;
80 struct WebPoint; 81 struct WebPoint;
81 struct WebPrintParams; 82 struct WebPrintParams;
82 struct WebRect; 83 struct WebRect;
83 struct WebScriptSource; 84 struct WebScriptSource;
84 struct WebSize; 85 struct WebSize;
85 struct WebURLLoaderOptions; 86 struct WebURLLoaderOptions;
86 87
87 template <typename T> class WebVector; 88 template <typename T> class WebVector;
88 89
89 typedef class WebFrame WebLocalFrame; 90 // Frames may be rendered in process ('local') or out of process ('remote').
90 91 // A remote frame is always cross-site; a local frame may be either same-site or
92 // cross-site.
93 // WebFrame is the base class for both WebLocalFrame and WebRemoteFrame and
94 // contains methods that are valid on both local and remote frames, such as
95 // getting a frame's parent or its opener.
91 class WebFrame { 96 class WebFrame {
92 public: 97 public:
93 // Control of renderTreeAsText output 98 // Control of renderTreeAsText output
94 enum RenderAsTextControl { 99 enum RenderAsTextControl {
95 RenderAsTextNormal = 0, 100 RenderAsTextNormal = 0,
96 RenderAsTextDebug = 1 << 0, 101 RenderAsTextDebug = 1 << 0,
97 RenderAsTextPrinting = 1 << 1 102 RenderAsTextPrinting = 1 << 1
98 }; 103 };
99 typedef unsigned RenderAsTextControls; 104 typedef unsigned RenderAsTextControls;
100 105
101 // Creates a WebFrame. Delete this WebFrame by calling WebFrame::close().
102 // It is valid to pass a null client pointer.
103 BLINK_EXPORT static WebLocalFrame* create(WebFrameClient*);
104
105 // Returns the number of live WebFrame objects, used for leak checking. 106 // Returns the number of live WebFrame objects, used for leak checking.
106 BLINK_EXPORT static int instanceCount(); 107 BLINK_EXPORT static int instanceCount();
107 108
108 // Returns the WebFrame associated with the current V8 context. This
109 // function can return 0 if the context is associated with a Document that
110 // is not currently being displayed in a Frame.
111 BLINK_EXPORT static WebLocalFrame* frameForCurrentContext();
112
113 // Returns the frame corresponding to the given context. This can return 0
114 // if the context is detached from the frame, or if the context doesn't
115 // correspond to a frame (e.g., workers).
116 BLINK_EXPORT static WebLocalFrame* frameForContext(v8::Handle<v8::Context>);
117
118 // Returns the frame inside a given frame or iframe element. Returns 0 if
119 // the given element is not a frame, iframe or if the frame is empty.
120 BLINK_EXPORT static WebLocalFrame* fromFrameOwnerElement(const WebElement&);
121
122 virtual WebLocalFrame* toWebLocalFrame() = 0; 109 virtual WebLocalFrame* toWebLocalFrame() = 0;
123 110
124 // This method closes and deletes the WebFrame. 111 // This method closes and deletes the WebFrame.
125 virtual void close() = 0; 112 virtual void close() = 0;
126 113
127 114
128 // Basic properties --------------------------------------------------- 115 // Basic properties ---------------------------------------------------
129 116
130 // The unique name of this frame. 117 // The unique name of this frame.
131 virtual WebString uniqueName() const = 0; 118 virtual WebString uniqueName() const = 0;
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 // text form. This is used only by layout tests. 667 // text form. This is used only by layout tests.
681 virtual WebString layerTreeAsText(bool showDebugInfo = false) const = 0; 668 virtual WebString layerTreeAsText(bool showDebugInfo = false) const = 0;
682 669
683 protected: 670 protected:
684 ~WebFrame() { } 671 ~WebFrame() { }
685 }; 672 };
686 673
687 } // namespace blink 674 } // namespace blink
688 675
689 #endif 676 #endif
OLDNEW
« no previous file with comments | « Source/web/tests/WebHelperPluginTest.cpp ('k') | public/web/WebLocalFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698