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

Unified Diff: athena/content/app_activity.cc

Issue 694413005: athena: Introduce ActivityView. (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 9824ca2bdef617cc133e3062920636a031c4d1c1..b8b1c5fa22037a7bf7134f70ef64d48a3ba723f0 100644
--- a/athena/content/app_activity.cc
+++ b/athena/content/app_activity.cc
@@ -5,6 +5,7 @@
#include "athena/content/app_activity.h"
#include "athena/activity/public/activity_manager.h"
+#include "athena/activity/public/activity_view.h"
#include "athena/content/app_activity_registry.h"
#include "athena/content/content_proxy.h"
#include "athena/content/media_utils.h"
@@ -24,7 +25,8 @@ AppActivity::AppActivity(const std::string& app_id, views::WebView* web_view)
: app_id_(app_id),
web_view_(web_view),
current_state_(ACTIVITY_UNLOADED),
- app_activity_registry_(nullptr) {
+ app_activity_registry_(nullptr),
+ activity_view_(nullptr) {
Observe(web_view->GetWebContents());
}
@@ -166,6 +168,11 @@ gfx::ImageSkia AppActivity::GetIcon() const {
return gfx::ImageSkia();
}
+void AppActivity::SetActivityView(ActivityView* view) {
+ DCHECK(!activity_view_);
+ activity_view_ = view;
+}
+
bool AppActivity::UsesFrame() const {
return false;
}
@@ -200,7 +207,8 @@ AppActivity::AppActivity(const std::string& app_id)
: app_id_(app_id),
web_view_(nullptr),
current_state_(ACTIVITY_UNLOADED),
- app_activity_registry_(nullptr) {
+ app_activity_registry_(nullptr),
+ activity_view_(nullptr) {
}
AppActivity::~AppActivity() {
@@ -211,12 +219,14 @@ AppActivity::~AppActivity() {
void AppActivity::TitleWasSet(content::NavigationEntry* entry,
bool explicit_set) {
- ActivityManager::Get()->UpdateActivity(this);
+ if (activity_view_)
+ activity_view_->UpdateTitle();
}
void AppActivity::DidUpdateFaviconURL(
const std::vector<content::FaviconURL>& candidates) {
- ActivityManager::Get()->UpdateActivity(this);
+ if (activity_view_)
+ activity_view_->UpdateIcon();
}
// Register an |activity| with an application.
« 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