| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "sky/engine/config.h" | 5 #include "sky/engine/config.h" |
| 6 #include "sky/engine/public/web/WebFrame.h" | 6 #include "sky/engine/public/web/WebFrame.h" |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include "sky/engine/platform/UserGestureIndicator.h" | |
| 10 #include "sky/engine/web/WebLocalFrameImpl.h" | 9 #include "sky/engine/web/WebLocalFrameImpl.h" |
| 11 | 10 |
| 12 namespace blink { | 11 namespace blink { |
| 13 | 12 |
| 14 Frame* toCoreFrame(const WebFrame* frame) | 13 Frame* toCoreFrame(const WebFrame* frame) |
| 15 { | 14 { |
| 16 if (!frame) | 15 if (!frame) |
| 17 return 0; | 16 return 0; |
| 18 | 17 |
| 19 return static_cast<Frame*>(toWebLocalFrameImpl(frame)->frame()); | 18 return static_cast<Frame*>(toWebLocalFrameImpl(frame)->frame()); |
| 20 } | 19 } |
| 21 | 20 |
| 22 v8::Handle<v8::Value> WebFrame::executeScriptAndReturnValueForTests(const WebScr
iptSource& source) | |
| 23 { | |
| 24 // FIXME: This fake UserGestureIndicator is required for a bunch of browser | |
| 25 // tests to pass. We should update the tests to simulate input and get rid | |
| 26 // of this. | |
| 27 // http://code.google.com/p/chromium/issues/detail?id=86397 | |
| 28 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture); | |
| 29 return executeScriptAndReturnValue(source); | |
| 30 } | |
| 31 | |
| 32 WebFrame* WebFrame::fromFrame(Frame* frame) | 21 WebFrame* WebFrame::fromFrame(Frame* frame) |
| 33 { | 22 { |
| 34 if (!frame) | 23 if (!frame) |
| 35 return 0; | 24 return 0; |
| 36 return WebLocalFrameImpl::fromFrame(toLocalFrame(*frame)); | 25 return WebLocalFrameImpl::fromFrame(toLocalFrame(*frame)); |
| 37 } | 26 } |
| 38 | 27 |
| 39 WebFrame::WebFrame() | 28 WebFrame::WebFrame() |
| 40 { | 29 { |
| 41 } | 30 } |
| 42 | 31 |
| 43 WebFrame::~WebFrame() | 32 WebFrame::~WebFrame() |
| 44 { | 33 { |
| 45 } | 34 } |
| 46 | 35 |
| 47 } // namespace blink | 36 } // namespace blink |
| OLD | NEW |