OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <shellapi.h> | 8 #include <shellapi.h> |
9 #include <windows.h> | 9 #include <windows.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 1711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1722 std::string page_url = EscapeQueryParamValue(tc->GetURL().spec(), false); | 1722 std::string page_url = EscapeQueryParamValue(tc->GetURL().spec(), false); |
1723 std::string mailto = std::string("mailto:?subject=Fwd:%20") + | 1723 std::string mailto = std::string("mailto:?subject=Fwd:%20") + |
1724 title + "&body=%0A%0A" + page_url; | 1724 title + "&body=%0A%0A" + page_url; |
1725 platform_util::OpenExternal(GURL(mailto)); | 1725 platform_util::OpenExternal(GURL(mailto)); |
1726 } | 1726 } |
1727 | 1727 |
1728 void Browser::Print() { | 1728 void Browser::Print() { |
1729 if (switches::IsPrintPreviewEnabled()) | 1729 if (switches::IsPrintPreviewEnabled()) |
1730 GetSelectedTabContentsWrapper()->print_view_manager()->PrintPreviewNow(); | 1730 GetSelectedTabContentsWrapper()->print_view_manager()->PrintPreviewNow(); |
1731 else | 1731 else |
1732 GetSelectedTabContentsWrapper()->print_view_manager()->PrintNow(); | 1732 GetSelectedTabContentsWrapper()->print_view_manager()->PrintNow(NULL); |
1733 } | 1733 } |
1734 | 1734 |
1735 void Browser::ToggleEncodingAutoDetect() { | 1735 void Browser::ToggleEncodingAutoDetect() { |
1736 UserMetrics::RecordAction(UserMetricsAction("AutoDetectChange")); | 1736 UserMetrics::RecordAction(UserMetricsAction("AutoDetectChange")); |
1737 encoding_auto_detect_.SetValue(!encoding_auto_detect_.GetValue()); | 1737 encoding_auto_detect_.SetValue(!encoding_auto_detect_.GetValue()); |
1738 // If "auto detect" is turned on, then any current override encoding | 1738 // If "auto detect" is turned on, then any current override encoding |
1739 // is cleared. This also implicitly performs a reload. | 1739 // is cleared. This also implicitly performs a reload. |
1740 // OTOH, if "auto detect" is turned off, we don't change the currently | 1740 // OTOH, if "auto detect" is turned off, we don't change the currently |
1741 // active encoding. | 1741 // active encoding. |
1742 if (encoding_auto_detect_.GetValue()) { | 1742 if (encoding_auto_detect_.GetValue()) { |
(...skipping 2953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4696 TabContents* current_tab = GetSelectedTabContents(); | 4696 TabContents* current_tab = GetSelectedTabContents(); |
4697 if (current_tab) { | 4697 if (current_tab) { |
4698 content_restrictions = current_tab->content_restrictions(); | 4698 content_restrictions = current_tab->content_restrictions(); |
4699 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry(); | 4699 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry(); |
4700 // See comment in UpdateCommandsForTabState about why we call url(). | 4700 // See comment in UpdateCommandsForTabState about why we call url(). |
4701 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL())) | 4701 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL())) |
4702 content_restrictions |= CONTENT_RESTRICTION_SAVE; | 4702 content_restrictions |= CONTENT_RESTRICTION_SAVE; |
4703 } | 4703 } |
4704 return content_restrictions; | 4704 return content_restrictions; |
4705 } | 4705 } |
OLD | NEW |