| 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/keyboard_codes.h" | 10 #include "base/keyboard_codes.h" |
| (...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 953 | 953 |
| 954 #if defined(OS_WIN) | 954 #if defined(OS_WIN) |
| 955 void Browser::ClosePopups() { | 955 void Browser::ClosePopups() { |
| 956 UserMetrics::RecordAction(L"CloseAllSuppressedPopups", profile_); | 956 UserMetrics::RecordAction(L"CloseAllSuppressedPopups", profile_); |
| 957 GetSelectedTabContents()->CloseAllSuppressedPopups(); | 957 GetSelectedTabContents()->CloseAllSuppressedPopups(); |
| 958 } | 958 } |
| 959 #endif | 959 #endif |
| 960 | 960 |
| 961 void Browser::Print() { | 961 void Browser::Print() { |
| 962 UserMetrics::RecordAction(L"PrintPreview", profile_); | 962 UserMetrics::RecordAction(L"PrintPreview", profile_); |
| 963 #if defined(OS_WIN) || defined(OS_LINUX) | |
| 964 GetSelectedTabContents()->PrintPreview(); | 963 GetSelectedTabContents()->PrintPreview(); |
| 965 #else | |
| 966 NOTIMPLEMENTED(); | |
| 967 #endif | |
| 968 } | 964 } |
| 969 | 965 |
| 970 void Browser::ToggleEncodingAutoDetect() { | 966 void Browser::ToggleEncodingAutoDetect() { |
| 971 UserMetrics::RecordAction(L"AutoDetectChange", profile_); | 967 UserMetrics::RecordAction(L"AutoDetectChange", profile_); |
| 972 encoding_auto_detect_.SetValue(!encoding_auto_detect_.GetValue()); | 968 encoding_auto_detect_.SetValue(!encoding_auto_detect_.GetValue()); |
| 973 // If "auto detect" is turned on, then any current override encoding | 969 // If "auto detect" is turned on, then any current override encoding |
| 974 // is cleared. This also implicitly performs a reload. | 970 // is cleared. This also implicitly performs a reload. |
| 975 // OTOH, if "auto detect" is turned off, we don't change the currently | 971 // OTOH, if "auto detect" is turned off, we don't change the currently |
| 976 // active encoding. | 972 // active encoding. |
| 977 if (encoding_auto_detect_.GetValue()) { | 973 if (encoding_auto_detect_.GetValue()) { |
| (...skipping 2003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2981 /////////////////////////////////////////////////////////////////////////////// | 2977 /////////////////////////////////////////////////////////////////////////////// |
| 2982 // BrowserToolbarModel (private): | 2978 // BrowserToolbarModel (private): |
| 2983 | 2979 |
| 2984 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { | 2980 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { |
| 2985 // This |current_tab| can be NULL during the initialization of the | 2981 // This |current_tab| can be NULL during the initialization of the |
| 2986 // toolbar during window creation (i.e. before any tabs have been added | 2982 // toolbar during window creation (i.e. before any tabs have been added |
| 2987 // to the window). | 2983 // to the window). |
| 2988 TabContents* current_tab = browser_->GetSelectedTabContents(); | 2984 TabContents* current_tab = browser_->GetSelectedTabContents(); |
| 2989 return current_tab ? ¤t_tab->controller() : NULL; | 2985 return current_tab ? ¤t_tab->controller() : NULL; |
| 2990 } | 2986 } |
| OLD | NEW |