Files.app: Dispatch 'drive-connection-changed' event on initialization of VolumeManag...
[chromium-blink-merge.git] / extensions / browser / app_window / app_window_contents.h
blob608b987302533aaf860da68cb31491832f67e6f2
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 content::WebContents* GetWebContents() const override;
39 WindowController* GetWindowController() const override;
41 private:
42 // content::WebContentsObserver
43 bool OnMessageReceived(const IPC::Message& message) override;
45 void UpdateDraggableRegions(const std::vector<DraggableRegion>& regions);
46 void SuspendRenderFrameHost(content::RenderFrameHost* rfh);
48 AppWindow* host_; // This class is owned by |host_|
49 GURL url_;
50 scoped_ptr<content::WebContents> web_contents_;
52 DISALLOW_COPY_AND_ASSIGN(AppWindowContentsImpl);
55 } // namespace extensions
57 #endif // EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_CONTENTS_H_