Update V8 to version 4.7.16.
[chromium-blink-merge.git] / extensions / browser / app_window / app_window_contents.h
blob7656a682c4b0742a6168ccccc4fb54ef5153c5dc
1 // Copyright 2013 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 EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_CONTENTS_H_
6 #define EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_CONTENTS_H_
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "content/public/browser/web_contents_observer.h"
11 #include "extensions/browser/app_window/app_window.h"
12 #include "url/gurl.h"
14 namespace content {
15 class BrowserContext;
16 class RenderFrameHost;
19 namespace extensions {
21 struct DraggableRegion;
23 // AppWindowContents class specific to app windows. It maintains a
24 // WebContents instance and observes it for the purpose of passing
25 // messages to the extensions system.
26 class AppWindowContentsImpl : public AppWindowContents,
27 public content::WebContentsObserver {
28 public:
29 explicit AppWindowContentsImpl(AppWindow* host);
30 ~AppWindowContentsImpl() override;
32 // AppWindowContents
33 void Initialize(content::BrowserContext* context, const GURL& url) override;
34 void LoadContents(int32 creator_process_id) override;
35 void NativeWindowChanged(NativeAppWindow* native_app_window) override;
36 void NativeWindowClosed() override;
37 void DispatchWindowShownForTests() const override;
38 void OnWindowReady() override;
39 content::WebContents* GetWebContents() const override;
40 WindowController* GetWindowController() const override;
42 private:
43 // content::WebContentsObserver
44 bool OnMessageReceived(const IPC::Message& message) override;
46 void UpdateDraggableRegions(const std::vector<DraggableRegion>& regions);
47 void SuspendRenderFrameHost(content::RenderFrameHost* rfh);
49 AppWindow* host_; // This class is owned by |host_|
50 GURL url_;
51 scoped_ptr<content::WebContents> web_contents_;
52 bool is_blocking_requests_;
53 bool is_window_ready_;
55 DISALLOW_COPY_AND_ASSIGN(AppWindowContentsImpl);
58 } // namespace extensions
60 #endif // EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_CONTENTS_H_