OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/content/shell/shell_app_activity.h" | 5 #include "athena/content/shell/shell_app_activity.h" |
6 | 6 |
| 7 #include "content/public/browser/web_contents.h" |
7 #include "extensions/shell/browser/shell_app_window.h" | 8 #include "extensions/shell/browser/shell_app_window.h" |
| 9 #include "ui/views/controls/webview/webview.h" |
8 | 10 |
9 namespace athena { | 11 namespace athena { |
10 | 12 |
11 ShellAppActivity::ShellAppActivity(extensions::ShellAppWindow* app_window, | 13 ShellAppActivity::ShellAppActivity(extensions::ShellAppWindow* app_window, |
12 const std::string& app_id) | 14 const std::string& app_id) |
13 : AppActivity(app_id), shell_app_window_(app_window) { | 15 : AppActivity(app_id), shell_app_window_(app_window) { |
14 } | 16 } |
15 | 17 |
16 ShellAppActivity::~ShellAppActivity() { | 18 ShellAppActivity::~ShellAppActivity() { |
17 } | 19 } |
18 | 20 |
19 content::WebContents* ShellAppActivity::GetWebContents() { | 21 views::Widget* ShellAppActivity::CreateWidget() { |
20 return shell_app_window_->GetAssociatedWebContents(); | 22 return NULL; // Use default widget. |
| 23 } |
| 24 |
| 25 views::WebView* ShellAppActivity::GetWebView() { |
| 26 content::WebContents* web_contents = |
| 27 shell_app_window_->GetAssociatedWebContents(); |
| 28 views::WebView* web_view = |
| 29 new views::WebView(web_contents->GetBrowserContext()); |
| 30 web_view->SetWebContents(web_contents); |
| 31 Observe(web_contents); |
| 32 return web_view; |
21 } | 33 } |
22 | 34 |
23 } // namespace athena | 35 } // namespace athena |
OLD | NEW |