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 CHROME_BROWSER_EXTENSIONS_API_TABS_ASH_PANEL_CONTENTS_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_TABS_ASH_PANEL_CONTENTS_H_
10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "chrome/browser/ui/ash/launcher/launcher_favicon_loader.h"
13 #include "extensions/browser/app_window/app_window.h"
21 namespace extensions
{
22 struct DraggableRegion
;
25 // extensions::AppWindowContents class specific to panel windows created by v1
26 // extenstions. This class maintains a WebContents instance and observes it for
27 // the purpose of passing messages to the extensions system. It also creates
28 // an extensions::WindowController instance for interfacing with the v1
30 class AshPanelContents
31 : public extensions::AppWindowContents
,
32 public LauncherFaviconLoader::Delegate
{
34 explicit AshPanelContents(extensions::AppWindow
* host
);
35 ~AshPanelContents() override
;
37 // extensions::AppWindowContents
38 void Initialize(content::BrowserContext
* context
, const GURL
& url
) override
;
39 void LoadContents(int32 creator_process_id
) override
;
40 void NativeWindowChanged(
41 extensions::NativeAppWindow
* native_app_window
) override
;
42 void NativeWindowClosed() override
;
43 void DispatchWindowShownForTests() const override
;
44 void OnWindowReady() override
;
45 content::WebContents
* GetWebContents() const override
;
46 extensions::WindowController
* GetWindowController() const override
;
48 // LauncherFaviconLoader::Delegate overrides:
49 void FaviconUpdated() override
;
51 LauncherFaviconLoader
* launcher_favicon_loader_for_test() {
52 return launcher_favicon_loader_
.get();
56 extensions::AppWindow
* host_
;
58 scoped_ptr
<content::WebContents
> web_contents_
;
59 scoped_ptr
<LauncherFaviconLoader
> launcher_favicon_loader_
;
61 DISALLOW_COPY_AND_ASSIGN(AshPanelContents
);
64 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_ASH_PANEL_CONTENTS_H_