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 1857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1868 if (!GetStatusBubble()) | 1868 if (!GetStatusBubble()) |
1869 return; | 1869 return; |
1870 | 1870 |
1871 if (source == GetSelectedTabContents()) { | 1871 if (source == GetSelectedTabContents()) { |
1872 PrefService* prefs = profile_->GetPrefs(); | 1872 PrefService* prefs = profile_->GetPrefs(); |
1873 GetStatusBubble()->SetURL(url, prefs->GetString(prefs::kAcceptLanguages)); | 1873 GetStatusBubble()->SetURL(url, prefs->GetString(prefs::kAcceptLanguages)); |
1874 } | 1874 } |
1875 } | 1875 } |
1876 | 1876 |
1877 void Browser::UpdateDownloadShelfVisibility(bool visible) { | 1877 void Browser::UpdateDownloadShelfVisibility(bool visible) { |
1878 GetStatusBubble()->UpdateDownloadShelfVisibility(visible); | 1878 if (GetStatusBubble()) |
| 1879 GetStatusBubble()->UpdateDownloadShelfVisibility(visible); |
1879 } | 1880 } |
1880 | 1881 |
1881 void Browser::ContentsZoomChange(bool zoom_in) { | 1882 void Browser::ContentsZoomChange(bool zoom_in) { |
1882 ExecuteCommand(zoom_in ? IDC_ZOOM_PLUS : IDC_ZOOM_MINUS); | 1883 ExecuteCommand(zoom_in ? IDC_ZOOM_PLUS : IDC_ZOOM_MINUS); |
1883 } | 1884 } |
1884 | 1885 |
1885 void Browser::TabContentsFocused(TabContents* tab_content) { | 1886 void Browser::TabContentsFocused(TabContents* tab_content) { |
1886 window_->TabContentsFocused(tab_content); | 1887 window_->TabContentsFocused(tab_content); |
1887 } | 1888 } |
1888 | 1889 |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2403 ++cur_update; | 2404 ++cur_update; |
2404 } | 2405 } |
2405 } | 2406 } |
2406 } | 2407 } |
2407 | 2408 |
2408 | 2409 |
2409 /////////////////////////////////////////////////////////////////////////////// | 2410 /////////////////////////////////////////////////////////////////////////////// |
2410 // Browser, Getters for UI (private): | 2411 // Browser, Getters for UI (private): |
2411 | 2412 |
2412 StatusBubble* Browser::GetStatusBubble() { | 2413 StatusBubble* Browser::GetStatusBubble() { |
2413 return window_->GetStatusBubble(); | 2414 return window_ ? window_->GetStatusBubble() : NULL; |
2414 } | 2415 } |
2415 | 2416 |
2416 /////////////////////////////////////////////////////////////////////////////// | 2417 /////////////////////////////////////////////////////////////////////////////// |
2417 // Browser, Session restore functions (private): | 2418 // Browser, Session restore functions (private): |
2418 | 2419 |
2419 void Browser::SyncHistoryWithTabs(int index) { | 2420 void Browser::SyncHistoryWithTabs(int index) { |
2420 if (!profile()->HasSessionService()) | 2421 if (!profile()->HasSessionService()) |
2421 return; | 2422 return; |
2422 SessionService* session_service = profile()->GetSessionService(); | 2423 SessionService* session_service = profile()->GetSessionService(); |
2423 if (session_service) { | 2424 if (session_service) { |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2773 /////////////////////////////////////////////////////////////////////////////// | 2774 /////////////////////////////////////////////////////////////////////////////// |
2774 // BrowserToolbarModel (private): | 2775 // BrowserToolbarModel (private): |
2775 | 2776 |
2776 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { | 2777 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { |
2777 // This |current_tab| can be NULL during the initialization of the | 2778 // This |current_tab| can be NULL during the initialization of the |
2778 // toolbar during window creation (i.e. before any tabs have been added | 2779 // toolbar during window creation (i.e. before any tabs have been added |
2779 // to the window). | 2780 // to the window). |
2780 TabContents* current_tab = browser_->GetSelectedTabContents(); | 2781 TabContents* current_tab = browser_->GetSelectedTabContents(); |
2781 return current_tab ? ¤t_tab->controller() : NULL; | 2782 return current_tab ? ¤t_tab->controller() : NULL; |
2782 } | 2783 } |
OLD | NEW |