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

Unified Diff: athena/content/web_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/web_activity.h ('k') | athena/test/base/sample_activity.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/content/web_activity.cc
diff --git a/athena/content/web_activity.cc b/athena/content/web_activity.cc
index 2aae6e86b5f5a80e419906a4af7878e450a88aa1..d6801b84a6139ea7f50501dd054c239645074a60 100644
--- a/athena/content/web_activity.cc
+++ b/athena/content/web_activity.cc
@@ -6,6 +6,7 @@
#include "athena/activity/public/activity_factory.h"
#include "athena/activity/public/activity_manager.h"
+#include "athena/activity/public/activity_view.h"
#include "athena/content/content_proxy.h"
#include "athena/content/media_utils.h"
#include "athena/content/public/dialogs.h"
@@ -441,6 +442,7 @@ WebActivity::WebActivity(content::BrowserContext* browser_context,
title_(title),
title_color_(kDefaultTitleColor),
current_state_(ACTIVITY_UNLOADED),
+ activity_view_(nullptr),
weak_ptr_factory_(this) {
// Order is important. The web activity helpers must be attached prior to the
// RenderView being created.
@@ -453,6 +455,7 @@ WebActivity::WebActivity(content::WebContents* contents)
web_view_(new AthenaWebView(contents, this)),
title_color_(kDefaultTitleColor),
current_state_(ACTIVITY_UNLOADED),
+ activity_view_(nullptr),
weak_ptr_factory_(this) {
// If the activity was created as a result of
// WebContentsDelegate::AddNewContents(), web activity helpers may not be
@@ -557,6 +560,11 @@ gfx::ImageSkia WebActivity::GetIcon() const {
return icon_;
}
+void WebActivity::SetActivityView(ActivityView* view) {
+ DCHECK(!activity_view_);
+ activity_view_ = view;
+}
+
bool WebActivity::UsesFrame() const {
return true;
}
@@ -589,7 +597,8 @@ void WebActivity::ResetContentsView() {
void WebActivity::TitleWasSet(content::NavigationEntry* entry,
bool explicit_set) {
- ActivityManager::Get()->UpdateActivity(this);
+ if (activity_view_)
+ activity_view_->UpdateTitle();
}
void WebActivity::DidNavigateMainFrame(
@@ -599,7 +608,8 @@ void WebActivity::DidNavigateMainFrame(
weak_ptr_factory_.InvalidateWeakPtrs();
icon_ = gfx::ImageSkia();
- ActivityManager::Get()->UpdateActivity(this);
+ if (activity_view_)
+ activity_view_->UpdateIcon();
}
void WebActivity::DidUpdateFaviconURL(
@@ -629,12 +639,14 @@ void WebActivity::OnDidDownloadFavicon(
const std::vector<gfx::Size>& original_bitmap_sizes) {
icon_ = CreateFaviconImageSkia(
bitmaps, original_bitmap_sizes, kIconSize, nullptr);
- ActivityManager::Get()->UpdateActivity(this);
+ if (activity_view_)
+ activity_view_->UpdateIcon();
}
void WebActivity::DidChangeThemeColor(SkColor theme_color) {
title_color_ = theme_color;
- ActivityManager::Get()->UpdateActivity(this);
+ if (activity_view_)
+ activity_view_->UpdateRepresentativeColor();
}
void WebActivity::HideContentProxy() {
« no previous file with comments | « athena/content/web_activity.h ('k') | athena/test/base/sample_activity.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698