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

Unified Diff: athena/content/app_activity.cc

Issue 702473005: athena: Remove ActivityViewModel::CreateWidget(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « athena/content/app_activity.h ('k') | athena/content/app_activity_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/content/app_activity.cc
diff --git a/athena/content/app_activity.cc b/athena/content/app_activity.cc
index f5c2866514729c708f0512f9e18d0f6347dbd08a..9824ca2bdef617cc133e3062920636a031c4d1c1 100644
--- a/athena/content/app_activity.cc
+++ b/athena/content/app_activity.cc
@@ -93,7 +93,9 @@ Activity::ActivityMediaState AppActivity::GetMediaState() {
}
aura::Window* AppActivity::GetWindow() {
- return !web_view_ ? nullptr : web_view_->GetWidget()->GetNativeWindow();
+ return web_view_ && web_view_->GetWidget()
+ ? web_view_->GetWidget()->GetNativeWindow()
+ : nullptr;
}
content::WebContents* AppActivity::GetWebContents() {
@@ -101,6 +103,10 @@ content::WebContents* AppActivity::GetWebContents() {
}
void AppActivity::Init() {
+ // Before we remove the proxy, we have to register the activity and
+ // initialize its to move it to the proper activity list location.
+ RegisterActivity();
+
DCHECK(app_activity_registry_);
Activity* app_proxy = app_activity_registry_->unloaded_activity_proxy();
if (app_proxy) {
@@ -135,6 +141,16 @@ void AppActivity::Init() {
// The proxy should now be deleted.
DCHECK(!app_activity_registry_->unloaded_activity_proxy());
}
+
+ // Make sure the content gets properly shown.
+ if (current_state_ == ACTIVITY_VISIBLE) {
+ HideContentProxy();
+ } else if (current_state_ == ACTIVITY_INVISIBLE) {
+ ShowContentProxy();
+ } else {
+ // If not previously specified, we change the state now to invisible..
+ SetCurrentState(ACTIVITY_INVISIBLE);
+ }
}
SkColor AppActivity::GetRepresentativeColor() const {
@@ -154,23 +170,6 @@ bool AppActivity::UsesFrame() const {
return false;
}
-views::Widget* AppActivity::CreateWidget() {
- // Before we remove the proxy, we have to register the activity and
- // initialize its to move it to the proper activity list location.
- RegisterActivity();
- Init();
- // Make sure the content gets properly shown.
- if (current_state_ == ACTIVITY_VISIBLE) {
- HideContentProxy();
- } else if (current_state_ == ACTIVITY_INVISIBLE) {
- ShowContentProxy();
- } else {
- // If not previously specified, we change the state now to invisible..
- SetCurrentState(ACTIVITY_INVISIBLE);
- }
- return web_view_->GetWidget();
-}
-
views::View* AppActivity::GetContentsView() {
return web_view_;
}
« no previous file with comments | « athena/content/app_activity.h ('k') | athena/content/app_activity_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698