| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "athena/content/web_activity.h" | 5 #include "athena/content/web_activity.h" |
| 6 | 6 |
| 7 #include "athena/activity/public/activity_factory.h" | 7 #include "athena/activity/public/activity_factory.h" |
| 8 #include "athena/activity/public/activity_manager.h" | 8 #include "athena/activity/public/activity_manager.h" |
| 9 #include "athena/content/content_proxy.h" | 9 #include "athena/content/content_proxy.h" |
| 10 #include "athena/content/media_utils.h" | 10 #include "athena/content/media_utils.h" |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 web_view_->InstallAccelerators(); | 523 web_view_->InstallAccelerators(); |
| 524 } | 524 } |
| 525 | 525 |
| 526 SkColor WebActivity::GetRepresentativeColor() const { | 526 SkColor WebActivity::GetRepresentativeColor() const { |
| 527 return title_color_; | 527 return title_color_; |
| 528 } | 528 } |
| 529 | 529 |
| 530 base::string16 WebActivity::GetTitle() const { | 530 base::string16 WebActivity::GetTitle() const { |
| 531 if (!title_.empty()) | 531 if (!title_.empty()) |
| 532 return title_; | 532 return title_; |
| 533 const base::string16& title = web_view_->GetWebContents()->GetTitle(); |
| 534 if (!title.empty()) |
| 535 return title; |
| 533 return base::UTF8ToUTF16(web_view_->GetWebContents()->GetVisibleURL().host()); | 536 return base::UTF8ToUTF16(web_view_->GetWebContents()->GetVisibleURL().host()); |
| 534 } | 537 } |
| 535 | 538 |
| 536 gfx::ImageSkia WebActivity::GetIcon() const { | 539 gfx::ImageSkia WebActivity::GetIcon() const { |
| 537 return icon_; | 540 return icon_; |
| 538 } | 541 } |
| 539 | 542 |
| 540 bool WebActivity::UsesFrame() const { | 543 bool WebActivity::UsesFrame() const { |
| 541 return true; | 544 return true; |
| 542 } | 545 } |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 if (content_proxy_.get()) | 628 if (content_proxy_.get()) |
| 626 content_proxy_.reset(NULL); | 629 content_proxy_.reset(NULL); |
| 627 } | 630 } |
| 628 | 631 |
| 629 void WebActivity::ShowContentProxy() { | 632 void WebActivity::ShowContentProxy() { |
| 630 if (!content_proxy_.get()) | 633 if (!content_proxy_.get()) |
| 631 content_proxy_.reset(new ContentProxy(web_view_)); | 634 content_proxy_.reset(new ContentProxy(web_view_)); |
| 632 } | 635 } |
| 633 | 636 |
| 634 } // namespace athena | 637 } // namespace athena |
| OLD | NEW |