| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/browser.h" | 5 #include "chrome/browser/browser.h" |
| 6 | 6 |
| 7 #include "app/animation.h" | 7 #include "app/animation.h" |
| 8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/idle_timer.h" | 10 #include "base/idle_timer.h" |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 return maximized; | 424 return maximized; |
| 425 } | 425 } |
| 426 | 426 |
| 427 SkBitmap Browser::GetCurrentPageIcon() const { | 427 SkBitmap Browser::GetCurrentPageIcon() const { |
| 428 TabContents* contents = GetSelectedTabContents(); | 428 TabContents* contents = GetSelectedTabContents(); |
| 429 // |contents| can be NULL since GetCurrentPageIcon() is called by the window | 429 // |contents| can be NULL since GetCurrentPageIcon() is called by the window |
| 430 // during the window's creation (before tabs have been added). | 430 // during the window's creation (before tabs have been added). |
| 431 return contents ? contents->GetFavIcon() : SkBitmap(); | 431 return contents ? contents->GetFavIcon() : SkBitmap(); |
| 432 } | 432 } |
| 433 | 433 |
| 434 string16 Browser::GetCurrentPageTitle() const { | 434 string16 Browser::GetWindowTitleForCurrentTab() const { |
| 435 TabContents* contents = tabstrip_model_.GetSelectedTabContents(); | 435 TabContents* contents = tabstrip_model_.GetSelectedTabContents(); |
| 436 string16 title; | 436 string16 title; |
| 437 | 437 |
| 438 // |contents| can be NULL because GetCurrentPageTitle is called by the window | 438 // |contents| can be NULL because GetWindowTitleForCurrentTab is called by the |
| 439 // during the window's creation (before tabs have been added). | 439 // window during the window's creation (before tabs have been added). |
| 440 if (contents) { | 440 if (contents) { |
| 441 title = contents->GetTitle(); | 441 title = contents->GetTitle(); |
| 442 FormatTitleForDisplay(&title); | 442 FormatTitleForDisplay(&title); |
| 443 } | 443 } |
| 444 if (title.empty()) | 444 if (title.empty()) |
| 445 title = l10n_util::GetStringUTF16(IDS_TAB_UNTITLED_TITLE); | 445 title = l10n_util::GetStringUTF16(IDS_TAB_UNTITLED_TITLE); |
| 446 | 446 |
| 447 #if defined(OS_MACOSX) || defined(OS_CHROMEOS) | 447 #if defined(OS_MACOSX) || defined(OS_CHROMEOS) |
| 448 // On Mac, we don't want to suffix the page title with the application name. | 448 // On Mac, we don't want to suffix the page title with the application name. |
| 449 return title; | 449 return title; |
| (...skipping 2314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2764 /////////////////////////////////////////////////////////////////////////////// | 2764 /////////////////////////////////////////////////////////////////////////////// |
| 2765 // BrowserToolbarModel (private): | 2765 // BrowserToolbarModel (private): |
| 2766 | 2766 |
| 2767 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { | 2767 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { |
| 2768 // This |current_tab| can be NULL during the initialization of the | 2768 // This |current_tab| can be NULL during the initialization of the |
| 2769 // toolbar during window creation (i.e. before any tabs have been added | 2769 // toolbar during window creation (i.e. before any tabs have been added |
| 2770 // to the window). | 2770 // to the window). |
| 2771 TabContents* current_tab = browser_->GetSelectedTabContents(); | 2771 TabContents* current_tab = browser_->GetSelectedTabContents(); |
| 2772 return current_tab ? ¤t_tab->controller() : NULL; | 2772 return current_tab ? ¤t_tab->controller() : NULL; |
| 2773 } | 2773 } |
| OLD | NEW |