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

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: fix 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) : NULL;
553 return favicon_tab_helper ? favicon_tab_helper->GetFavicon() : gfx::Image();
553 } 554 }
554 555
555 string16 Browser::GetWindowTitleForCurrentTab() const { 556 string16 Browser::GetWindowTitleForCurrentTab() const {
556 WebContents* contents = chrome::GetActiveWebContents(this); 557 WebContents* contents = chrome::GetActiveWebContents(this);
557 string16 title; 558 string16 title;
558 559
559 // |contents| can be NULL because GetWindowTitleForCurrentTab is called by the 560 // |contents| can be NULL because GetWindowTitleForCurrentTab is called by the
560 // window during the window's creation (before tabs have been added). 561 // window during the window's creation (before tabs have been added).
561 if (contents) { 562 if (contents) {
562 title = contents->GetTitle(); 563 title = contents->GetTitle();
(...skipping 1738 matching lines...) Expand 10 before | Expand all | Expand 10 after
2301 if (contents && !allow_js_access) { 2302 if (contents && !allow_js_access) {
2302 contents->web_contents()->GetController().LoadURL( 2303 contents->web_contents()->GetController().LoadURL(
2303 target_url, 2304 target_url,
2304 content::Referrer(), 2305 content::Referrer(),
2305 content::PAGE_TRANSITION_LINK, 2306 content::PAGE_TRANSITION_LINK,
2306 std::string()); // No extra headers. 2307 std::string()); // No extra headers.
2307 } 2308 }
2308 2309
2309 return contents != NULL; 2310 return contents != NULL;
2310 } 2311 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/launcher/browser_launcher_item_controller.cc ('k') | chrome/browser/ui/browser_commands.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698