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

Side by Side Diff: sky/engine/core/frame/LocalFrame.cpp

Issue 922893002: Merge the Sky Engine changes from the SkyDart branch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « sky/engine/core/frame/LocalFrame.h ('k') | sky/engine/core/frame/Location.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) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 13 matching lines...) Expand all
24 * You should have received a copy of the GNU Library General Public License 24 * You should have received a copy of the GNU Library General Public License
25 * along with this library; see the file COPYING.LIB. If not, write to 25 * along with this library; see the file COPYING.LIB. If not, write to
26 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 26 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
27 * Boston, MA 02110-1301, USA. 27 * Boston, MA 02110-1301, USA.
28 */ 28 */
29 29
30 #include "sky/engine/config.h" 30 #include "sky/engine/config.h"
31 #include "sky/engine/core/frame/LocalFrame.h" 31 #include "sky/engine/core/frame/LocalFrame.h"
32 32
33 #include "gen/sky/platform/RuntimeEnabledFeatures.h" 33 #include "gen/sky/platform/RuntimeEnabledFeatures.h"
34 #include "sky/engine/bindings/core/v8/ScriptController.h"
35 #include "sky/engine/core/editing/Editor.h" 34 #include "sky/engine/core/editing/Editor.h"
36 #include "sky/engine/core/editing/FrameSelection.h" 35 #include "sky/engine/core/editing/FrameSelection.h"
36 #include "sky/engine/core/editing/htmlediting.h"
37 #include "sky/engine/core/editing/InputMethodController.h" 37 #include "sky/engine/core/editing/InputMethodController.h"
38 #include "sky/engine/core/editing/SpellChecker.h" 38 #include "sky/engine/core/editing/SpellChecker.h"
39 #include "sky/engine/core/editing/htmlediting.h"
40 #include "sky/engine/core/events/Event.h" 39 #include "sky/engine/core/events/Event.h"
41 #include "sky/engine/core/fetch/ResourceFetcher.h" 40 #include "sky/engine/core/fetch/ResourceFetcher.h"
42 #include "sky/engine/core/frame/FrameConsole.h" 41 #include "sky/engine/core/frame/FrameConsole.h"
43 #include "sky/engine/core/frame/FrameDestructionObserver.h" 42 #include "sky/engine/core/frame/FrameDestructionObserver.h"
44 #include "sky/engine/core/frame/FrameHost.h" 43 #include "sky/engine/core/frame/FrameHost.h"
45 #include "sky/engine/core/frame/FrameView.h" 44 #include "sky/engine/core/frame/FrameView.h"
46 #include "sky/engine/core/frame/LocalDOMWindow.h" 45 #include "sky/engine/core/frame/LocalDOMWindow.h"
47 #include "sky/engine/core/frame/NewEventHandler.h" 46 #include "sky/engine/core/frame/NewEventHandler.h"
48 #include "sky/engine/core/frame/Settings.h" 47 #include "sky/engine/core/frame/Settings.h"
49 #include "sky/engine/core/inspector/ConsoleMessageStorage.h"
50 #include "sky/engine/core/loader/FrameLoaderClient.h" 48 #include "sky/engine/core/loader/FrameLoaderClient.h"
51 #include "sky/engine/core/loader/MojoLoader.h" 49 #include "sky/engine/core/loader/MojoLoader.h"
52 #include "sky/engine/core/page/EventHandler.h" 50 #include "sky/engine/core/page/EventHandler.h"
53 #include "sky/engine/core/page/FocusController.h" 51 #include "sky/engine/core/page/FocusController.h"
54 #include "sky/engine/core/page/Page.h" 52 #include "sky/engine/core/page/Page.h"
55 #include "sky/engine/core/rendering/HitTestResult.h" 53 #include "sky/engine/core/rendering/HitTestResult.h"
56 #include "sky/engine/core/rendering/RenderLayer.h" 54 #include "sky/engine/core/rendering/RenderLayer.h"
57 #include "sky/engine/core/rendering/RenderView.h" 55 #include "sky/engine/core/rendering/RenderView.h"
56 #include "sky/engine/core/script/dart_controller.h"
58 #include "sky/engine/platform/graphics/GraphicsContext.h" 57 #include "sky/engine/platform/graphics/GraphicsContext.h"
59 #include "sky/engine/platform/graphics/ImageBuffer.h" 58 #include "sky/engine/platform/graphics/ImageBuffer.h"
60 #include "sky/engine/platform/text/TextStream.h" 59 #include "sky/engine/platform/text/TextStream.h"
61 #include "sky/engine/wtf/PassOwnPtr.h" 60 #include "sky/engine/wtf/PassOwnPtr.h"
62 #include "sky/engine/wtf/StdLibExtras.h" 61 #include "sky/engine/wtf/StdLibExtras.h"
63 62
64 namespace blink { 63 namespace blink {
65 64
66 inline LocalFrame::LocalFrame(FrameLoaderClient* client, FrameHost* host) 65 inline LocalFrame::LocalFrame(FrameLoaderClient* client, FrameHost* host)
67 : Frame(client, host) 66 : Frame(client, host)
68 , m_deprecatedLoader(this) 67 , m_deprecatedLoader(this)
69 , m_mojoLoader(adoptPtr(new MojoLoader(*this))) 68 , m_mojoLoader(adoptPtr(new MojoLoader(*this)))
70 , m_script(adoptPtr(new ScriptController(this))) 69 , m_dart(adoptPtr(new DartController()))
71 , m_editor(Editor::create(*this)) 70 , m_editor(Editor::create(*this))
72 , m_spellChecker(SpellChecker::create(*this)) 71 , m_spellChecker(SpellChecker::create(*this))
73 , m_selection(FrameSelection::create(this)) 72 , m_selection(FrameSelection::create(this))
74 , m_eventHandler(adoptPtr(new EventHandler(this))) 73 , m_eventHandler(adoptPtr(new EventHandler(this)))
75 , m_newEventHandler(adoptPtr(new NewEventHandler(*this))) 74 , m_newEventHandler(adoptPtr(new NewEventHandler(*this)))
76 , m_console(FrameConsole::create(*this)) 75 , m_console(FrameConsole::create(*this))
77 , m_inputMethodController(InputMethodController::create(*this)) 76 , m_inputMethodController(InputMethodController::create(*this))
78 { 77 {
79 page()->setMainFrame(this); 78 page()->setMainFrame(this);
80 } 79 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 // will trigger the unload event handlers of any child frames, and those eve nt 117 // will trigger the unload event handlers of any child frames, and those eve nt
119 // handlers might start a new subresource load in this frame. 118 // handlers might start a new subresource load in this frame.
120 m_deprecatedLoader.stopAllLoaders(); 119 m_deprecatedLoader.stopAllLoaders();
121 120
122 setView(nullptr); 121 setView(nullptr);
123 willDetachFrameHost(); 122 willDetachFrameHost();
124 123
125 // Finish all cleanup work that might require talking to the embedder. 124 // Finish all cleanup work that might require talking to the embedder.
126 // Notify ScriptController that the frame is closing, since its cleanup ends up calling 125 // Notify ScriptController that the frame is closing, since its cleanup ends up calling
127 // back to FrameLoaderClient via WindowProxy. 126 // back to FrameLoaderClient via WindowProxy.
128 script().clearForClose(); 127 dart().ClearForClose();
129 // After this, we must no longer talk to the client since this clears 128 // After this, we must no longer talk to the client since this clears
130 // its owning reference back to our owning LocalFrame. 129 // its owning reference back to our owning LocalFrame.
131 loaderClient()->detachedFromParent(); 130 loaderClient()->detachedFromParent();
132 clearClient(); 131 clearClient();
133 detachFromFrameHost(); 132 detachFromFrameHost();
134 } 133 }
135 134
136 void LocalFrame::setView(PassRefPtr<FrameView> view) 135 void LocalFrame::setView(PassRefPtr<FrameView> view)
137 { 136 {
138 // We the custom scroll bars as early as possible to prevent m_doc->detach() 137 // We the custom scroll bars as early as possible to prevent m_doc->detach()
(...skipping 23 matching lines...) Expand all
162 161
163 ASSERT(fabs(originalSize.width()) > std::numeric_limits<float>::epsilon()); 162 ASSERT(fabs(originalSize.width()) > std::numeric_limits<float>::epsilon());
164 float ratio = originalSize.height() / originalSize.width(); 163 float ratio = originalSize.height() / originalSize.width();
165 resultSize.setWidth(floorf(expectedSize.width())); 164 resultSize.setWidth(floorf(expectedSize.width()));
166 resultSize.setHeight(floorf(resultSize.width() * ratio)); 165 resultSize.setHeight(floorf(resultSize.width() * ratio));
167 return resultSize; 166 return resultSize;
168 } 167 }
169 168
170 void LocalFrame::setDOMWindow(PassRefPtr<LocalDOMWindow> domWindow) 169 void LocalFrame::setDOMWindow(PassRefPtr<LocalDOMWindow> domWindow)
171 { 170 {
172 if (m_domWindow) {
173 console().messageStorage()->frameWindowDiscarded(m_domWindow.get());
174 }
175 if (domWindow)
176 script().clearWindowProxy();
177 Frame::setDOMWindow(domWindow); 171 Frame::setDOMWindow(domWindow);
178 } 172 }
179 173
180 void LocalFrame::didChangeVisibilityState() 174 void LocalFrame::didChangeVisibilityState()
181 { 175 {
182 if (document()) 176 if (document())
183 document()->didChangeVisibilityState(); 177 document()->didChangeVisibilityState();
184 } 178 }
185 179
186 void LocalFrame::addDestructionObserver(FrameDestructionObserver* observer) 180 void LocalFrame::addDestructionObserver(FrameDestructionObserver* observer)
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 } 306 }
313 307
314 double LocalFrame::devicePixelRatio() const 308 double LocalFrame::devicePixelRatio() const
315 { 309 {
316 if (!m_host) 310 if (!m_host)
317 return 0; 311 return 0;
318 return m_host->deviceScaleFactor(); 312 return m_host->deviceScaleFactor();
319 } 313 }
320 314
321 } // namespace blink 315 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/frame/LocalFrame.h ('k') | sky/engine/core/frame/Location.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698