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

Side by Side Diff: athena/content/web_activity.cc

Issue 644723003: Athena WebActivity returns page title when it's set. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698