| Index: athena/content/app_activity.cc
|
| diff --git a/athena/content/app_activity.cc b/athena/content/app_activity.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..981ccb8f23541442acc184b396e37c481155afd8
|
| --- /dev/null
|
| +++ b/athena/content/app_activity.cc
|
| @@ -0,0 +1,57 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "athena/content/app_activity.h"
|
| +
|
| +#include "athena/activity/public/activity_manager.h"
|
| +#include "content/public/browser/web_contents.h"
|
| +#include "ui/views/controls/webview/webview.h"
|
| +
|
| +namespace athena {
|
| +
|
| +// AppActivity is similar to WebActivity but doesn't have accelerators.
|
| +AppActivity::AppActivity(content::WebContents* web_contents)
|
| + : web_contents_(web_contents), web_view_(NULL) {
|
| + DCHECK(web_contents_);
|
| +}
|
| +
|
| +AppActivity::~AppActivity() {
|
| +}
|
| +
|
| +ActivityViewModel* AppActivity::GetActivityViewModel() {
|
| + return this;
|
| +}
|
| +
|
| +void AppActivity::Init() {
|
| +}
|
| +
|
| +SkColor AppActivity::GetRepresentativeColor() {
|
| + // TODO(sad): Compute the color from the favicon.
|
| + return SK_ColorGRAY;
|
| +}
|
| +
|
| +base::string16 AppActivity::GetTitle() {
|
| + return web_view_->GetWebContents()->GetTitle();
|
| +}
|
| +
|
| +views::View* AppActivity::GetContentsView() {
|
| + if (!web_view_) {
|
| + web_view_ = new views::WebView(web_contents_->GetBrowserContext());
|
| + web_view_->SetWebContents(web_contents_);
|
| + Observe(web_view_->GetWebContents());
|
| + }
|
| + return web_view_;
|
| +}
|
| +
|
| +void AppActivity::TitleWasSet(content::NavigationEntry* entry,
|
| + bool explicit_set) {
|
| + ActivityManager::Get()->UpdateActivity(this);
|
| +}
|
| +
|
| +void AppActivity::DidUpdateFaviconURL(
|
| + const std::vector<content::FaviconURL>& candidates) {
|
| + ActivityManager::Get()->UpdateActivity(this);
|
| +}
|
| +
|
| +} // namespace athena
|
|
|