| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "athena/content/shell/shell_app_activity.h" | |
| 6 | |
| 7 #include "content/public/browser/web_contents.h" | |
| 8 #include "extensions/browser/app_window/app_window.h" | |
| 9 #include "extensions/browser/app_window/native_app_window.h" | |
| 10 #include "ui/views/controls/webview/webview.h" | |
| 11 | |
| 12 namespace athena { | |
| 13 | |
| 14 ShellAppActivity::ShellAppActivity(extensions::AppWindow* app_window) | |
| 15 : AppActivity(app_window->extension_id()), app_window_(app_window) { | |
| 16 DCHECK(app_window_); | |
| 17 } | |
| 18 | |
| 19 ShellAppActivity::~ShellAppActivity() { | |
| 20 app_window_->GetBaseWindow()->Close(); // Deletes |app_window_|. | |
| 21 } | |
| 22 | |
| 23 views::Widget* ShellAppActivity::CreateWidget() { | |
| 24 return NULL; // Use default widget. | |
| 25 } | |
| 26 | |
| 27 views::WebView* ShellAppActivity::GetWebView() { | |
| 28 content::WebContents* web_contents = app_window_->web_contents(); | |
| 29 views::WebView* web_view = | |
| 30 new views::WebView(web_contents->GetBrowserContext()); | |
| 31 web_view->SetWebContents(web_contents); | |
| 32 Observe(web_contents); | |
| 33 return web_view; | |
| 34 } | |
| 35 | |
| 36 } // namespace athena | |
| OLD | NEW |