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

Unified Diff: athena/content/web_activity.cc

Issue 314303004: Use webview in web activity (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added unittests Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: athena/content/web_activity.cc
diff --git a/athena/content/web_activity.cc b/athena/content/web_activity.cc
index 12069d0bcd615b6c1c8283f0f4ab9a6cebe28126..fa7b6da24114278939c96cc0898e75c4d60b4c7a 100644
--- a/athena/content/web_activity.cc
+++ b/athena/content/web_activity.cc
@@ -7,11 +7,13 @@
#include "athena/activity/public/activity_manager.h"
#include "base/strings/utf_string_conversions.h"
#include "content/public/browser/web_contents.h"
+#include "ui/views/controls/webview/webview.h"
namespace athena {
-WebActivity::WebActivity(content::WebContents* contents)
- : content::WebContentsObserver(contents) {
+WebActivity::WebActivity(content::BrowserContext* browser_context,
+ const GURL& url)
+ : browser_context_(browser_context), url_(url), web_view_(NULL) {
}
WebActivity::~WebActivity() {
@@ -27,11 +29,16 @@ SkColor WebActivity::GetRepresentativeColor() {
}
std::string WebActivity::GetTitle() {
- return base::UTF16ToUTF8(web_contents()->GetTitle());
+ return base::UTF16ToUTF8(web_view_->GetWebContents()->GetTitle());
Jun Mukai 2014/06/06 20:17:29 Don't we need to check web_view_? It might be cal
oshima 2014/06/06 20:55:51 This never called before GetContentsView(), and th
Jun Mukai 2014/06/06 20:57:03 fair enough. thanks.
}
-aura::Window* WebActivity::GetNativeWindow() {
- return web_contents()->GetNativeView();
+views::View* WebActivity::GetContentsView() {
+ if (!web_view_) {
+ web_view_ = new views::WebView(browser_context_);
+ web_view_->LoadInitialURL(url_);
+ Observe(web_view_->GetWebContents());
+ }
+ return web_view_;
}
void WebActivity::TitleWasSet(content::NavigationEntry* entry,

Powered by Google App Engine
This is Rietveld 408576698