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

Side by Side Diff: chrome/browser/ui/browser.cc

Issue 11011002: Switch FaviconTabHelper to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/ui/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #endif // OS_WIN 10 #endif // OS_WIN
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 } 538 }
539 539
540 bool Browser::is_devtools() const { 540 bool Browser::is_devtools() const {
541 return app_name_ == DevToolsWindow::kDevToolsApp; 541 return app_name_ == DevToolsWindow::kDevToolsApp;
542 } 542 }
543 543
544 /////////////////////////////////////////////////////////////////////////////// 544 ///////////////////////////////////////////////////////////////////////////////
545 // Browser, State Storage and Retrieval for UI: 545 // Browser, State Storage and Retrieval for UI:
546 546
547 gfx::Image Browser::GetCurrentPageIcon() const { 547 gfx::Image Browser::GetCurrentPageIcon() const {
548 TabContents* contents = chrome::GetActiveTabContents(this); 548 WebContents* web_contents = chrome::GetActiveWebContents(this);
549 // |contents| can be NULL since GetCurrentPageIcon() is called by the window 549 // |web_contents| can be NULL since GetCurrentPageIcon() is called by the
550 // during the window's creation (before tabs have been added). 550 // window during the window's creation (before tabs have been added).
551 return contents ? 551 FaviconTabHelper* favicon_tab_helper =
552 contents->favicon_tab_helper()->GetFavicon() : gfx::Image(); 552 web_contents ? FaviconTabHelper::FromWebContents(web_contents)
553 : NULL;
stevenjb 2012/10/01 17:56:51 nit: does : NULL; fit on the previous line?
Avi (use Gerrit) 2012/10/01 19:23:57 Done.
554 return favicon_tab_helper ? favicon_tab_helper->GetFavicon() : gfx::Image();
553 } 555 }
554 556
555 string16 Browser::GetWindowTitleForCurrentTab() const { 557 string16 Browser::GetWindowTitleForCurrentTab() const {
556 WebContents* contents = chrome::GetActiveWebContents(this); 558 WebContents* contents = chrome::GetActiveWebContents(this);
557 string16 title; 559 string16 title;
558 560
559 // |contents| can be NULL because GetWindowTitleForCurrentTab is called by the 561 // |contents| can be NULL because GetWindowTitleForCurrentTab is called by the
560 // window during the window's creation (before tabs have been added). 562 // window during the window's creation (before tabs have been added).
561 if (contents) { 563 if (contents) {
562 title = contents->GetTitle(); 564 title = contents->GetTitle();
(...skipping 1738 matching lines...) Expand 10 before | Expand all | Expand 10 after
2301 if (contents && !allow_js_access) { 2303 if (contents && !allow_js_access) {
2302 contents->web_contents()->GetController().LoadURL( 2304 contents->web_contents()->GetController().LoadURL(
2303 target_url, 2305 target_url,
2304 content::Referrer(), 2306 content::Referrer(),
2305 content::PAGE_TRANSITION_LINK, 2307 content::PAGE_TRANSITION_LINK,
2306 std::string()); // No extra headers. 2308 std::string()); // No extra headers.
2307 } 2309 }
2308 2310
2309 return contents != NULL; 2311 return contents != NULL;
2310 } 2312 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698