Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: athena/content/shell/shell_app_activity.cc

Issue 558243002: V2 app support step2 : Use NativeAppWindow for Activity's window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698