OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/extensions/api/tabs/ash_panel_contents.h" | 5 #include "chrome/browser/extensions/api/tabs/ash_panel_contents.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" | 8 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" |
9 #include "chrome/browser/extensions/api/tabs/tabs_windows_api.h" | 9 #include "chrome/browser/extensions/api/tabs/tabs_windows_api.h" |
10 #include "chrome/browser/extensions/api/tabs/windows_event_router.h" | 10 #include "chrome/browser/extensions/api/tabs/windows_event_router.h" |
11 #include "chrome/browser/extensions/extension_tab_util.h" | 11 #include "chrome/browser/extensions/extension_tab_util.h" |
12 #include "chrome/browser/extensions/window_controller_list.h" | 12 #include "chrome/browser/extensions/window_controller_list.h" |
13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/sessions/session_tab_helper.h" | 14 #include "chrome/browser/sessions/session_tab_helper.h" |
15 #include "chrome/browser/ui/extensions/native_app_window.h" | 15 #include "chrome/browser/ui/extensions/native_app_window.h" |
16 #include "chrome/browser/ui/extensions/shell_window.h" | |
17 #include "chrome/common/chrome_notification_types.h" | 16 #include "chrome/common/chrome_notification_types.h" |
18 #include "chrome/common/extensions/extension.h" | 17 #include "chrome/common/extensions/extension.h" |
19 #include "chrome/common/extensions/extension_messages.h" | 18 #include "chrome/common/extensions/extension_messages.h" |
20 #include "content/public/browser/site_instance.h" | 19 #include "content/public/browser/site_instance.h" |
21 #include "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
22 #include "ui/gfx/image/image.h" | 21 #include "ui/gfx/image/image.h" |
23 | 22 |
| 23 using apps::ShellWindow; |
| 24 |
24 // AshPanelWindowController ---------------------------------------------------- | 25 // AshPanelWindowController ---------------------------------------------------- |
25 | 26 |
26 // This class enables a ShellWindow instance to be accessed (to a limited | 27 // This class enables a ShellWindow instance to be accessed (to a limited |
27 // extent) via the chrome.windows and chrome.tabs API. This is a temporary | 28 // extent) via the chrome.windows and chrome.tabs API. This is a temporary |
28 // bridge to support instantiating ShellWindows from v1 apps, specifically | 29 // bridge to support instantiating ShellWindows from v1 apps, specifically |
29 // for creating Panels in Ash. See crbug.com/160645. | 30 // for creating Panels in Ash. See crbug.com/160645. |
30 class AshPanelWindowController : public extensions::WindowController { | 31 class AshPanelWindowController : public extensions::WindowController { |
31 public: | 32 public: |
32 AshPanelWindowController(ShellWindow* window, Profile* profile); | 33 AshPanelWindowController(ShellWindow* window, Profile* profile); |
33 virtual ~AshPanelWindowController(); | 34 virtual ~AshPanelWindowController(); |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 | 235 |
235 content::WebContents* AshPanelContents::GetAssociatedWebContents() const { | 236 content::WebContents* AshPanelContents::GetAssociatedWebContents() const { |
236 return web_contents_.get(); | 237 return web_contents_.get(); |
237 } | 238 } |
238 | 239 |
239 void AshPanelContents::OnRequest( | 240 void AshPanelContents::OnRequest( |
240 const ExtensionHostMsg_Request_Params& params) { | 241 const ExtensionHostMsg_Request_Params& params) { |
241 extension_function_dispatcher_->Dispatch( | 242 extension_function_dispatcher_->Dispatch( |
242 params, web_contents_->GetRenderViewHost()); | 243 params, web_contents_->GetRenderViewHost()); |
243 } | 244 } |
OLD | NEW |