Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / extensions / renderer / scoped_web_frame.h
blob7950552ad475c8ca01fe69572dc23d3b95a8e35b
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef SCOPED_WEB_FRAME_H_
6 #define SCOPED_WEB_FRAME_H_
8 #include "third_party/WebKit/public/web/WebLocalFrame.h"
9 #include "third_party/WebKit/public/web/WebView.h"
11 namespace extensions {
13 // ScopedWebFrame is a class to create a dummy webview and frame for testing.
14 // The dymmy webview and frame will be destructed when the scope exits.
15 class ScopedWebFrame {
16 public:
17 ScopedWebFrame();
18 ~ScopedWebFrame();
20 blink::WebLocalFrame* frame() { return frame_; }
22 private:
23 // The webview and the frame are kept alive by the ScopedWebFrame
24 // because they are not destructed unless ~ScopedWebFrame explicitly
25 // closes the webview and the frame.
26 blink::WebView* view_;
27 blink::WebLocalFrame* frame_;
28 DISALLOW_COPY_AND_ASSIGN(ScopedWebFrame);
31 } // namespace extensions
33 #endif // SCOPED_WEB_FRAME_H_