| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_TABS_ASH_PANEL_CONTENTS_H_ | |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_TABS_ASH_PANEL_CONTENTS_H_ | |
| 7 | |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include <memory> | |
| 11 #include <vector> | |
| 12 | |
| 13 #include "base/macros.h" | |
| 14 #include "chrome/browser/ui/ash/launcher/launcher_favicon_loader.h" | |
| 15 #include "extensions/browser/app_window/app_window.h" | |
| 16 | |
| 17 class GURL; | |
| 18 | |
| 19 // extensions::AppWindowContents class specific to panel windows created by v1 | |
| 20 // extenstions. This class maintains a WebContents instance and observes it for | |
| 21 // the purpose of passing messages to the extensions system. It also creates | |
| 22 // an extensions::WindowController instance for interfacing with the v1 | |
| 23 // extensions API. | |
| 24 class AshPanelContents | |
| 25 : public extensions::AppWindowContents, | |
| 26 public LauncherFaviconLoader::Delegate { | |
| 27 public: | |
| 28 explicit AshPanelContents(extensions::AppWindow* host); | |
| 29 ~AshPanelContents() override; | |
| 30 | |
| 31 // extensions::AppWindowContents | |
| 32 void Initialize(content::BrowserContext* context, | |
| 33 content::RenderFrameHost* creator_frame, | |
| 34 const GURL& url) override; | |
| 35 void LoadContents(int32_t creator_process_id) override; | |
| 36 void NativeWindowChanged( | |
| 37 extensions::NativeAppWindow* native_app_window) override; | |
| 38 void NativeWindowClosed() override; | |
| 39 void OnWindowReady() override; | |
| 40 content::WebContents* GetWebContents() const override; | |
| 41 extensions::WindowController* GetWindowController() const override; | |
| 42 | |
| 43 // LauncherFaviconLoader::Delegate overrides: | |
| 44 void FaviconUpdated() override; | |
| 45 | |
| 46 LauncherFaviconLoader* launcher_favicon_loader_for_test() { | |
| 47 return launcher_favicon_loader_.get(); | |
| 48 } | |
| 49 | |
| 50 private: | |
| 51 extensions::AppWindow* host_; | |
| 52 GURL url_; | |
| 53 std::unique_ptr<content::WebContents> web_contents_; | |
| 54 std::unique_ptr<LauncherFaviconLoader> launcher_favicon_loader_; | |
| 55 | |
| 56 DISALLOW_COPY_AND_ASSIGN(AshPanelContents); | |
| 57 }; | |
| 58 | |
| 59 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_ASH_PANEL_CONTENTS_H_ | |
| OLD | NEW |