OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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_commands.h" | 5 #include "chrome/browser/ui/browser_commands.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 | 808 |
809 void ManagePasswordsForPage(Browser* browser) { | 809 void ManagePasswordsForPage(Browser* browser) { |
810 if (!browser->window()->IsActive()) | 810 if (!browser->window()->IsActive()) |
811 return; | 811 return; |
812 | 812 |
813 WebContents* web_contents = | 813 WebContents* web_contents = |
814 browser->tab_strip_model()->GetActiveWebContents(); | 814 browser->tab_strip_model()->GetActiveWebContents(); |
815 chrome::ShowManagePasswordsBubble(web_contents); | 815 chrome::ShowManagePasswordsBubble(web_contents); |
816 } | 816 } |
817 | 817 |
| 818 #if defined(OS_WIN) |
818 void TogglePagePinnedToStartScreen(Browser* browser) { | 819 void TogglePagePinnedToStartScreen(Browser* browser) { |
819 #if defined(OS_WIN) | |
820 MetroPinTabHelper::FromWebContents( | 820 MetroPinTabHelper::FromWebContents( |
821 browser->tab_strip_model()->GetActiveWebContents())-> | 821 browser->tab_strip_model()->GetActiveWebContents())-> |
822 TogglePinnedToStartScreen(); | 822 TogglePinnedToStartScreen(); |
| 823 } |
823 #endif | 824 #endif |
824 } | |
825 | 825 |
826 void SavePage(Browser* browser) { | 826 void SavePage(Browser* browser) { |
827 content::RecordAction(UserMetricsAction("SavePage")); | 827 content::RecordAction(UserMetricsAction("SavePage")); |
828 WebContents* current_tab = browser->tab_strip_model()->GetActiveWebContents(); | 828 WebContents* current_tab = browser->tab_strip_model()->GetActiveWebContents(); |
829 if (current_tab && current_tab->GetContentsMimeType() == "application/pdf") | 829 if (current_tab && current_tab->GetContentsMimeType() == "application/pdf") |
830 content::RecordAction(UserMetricsAction("PDF.SavePage")); | 830 content::RecordAction(UserMetricsAction("PDF.SavePage")); |
831 current_tab->OnSavePage(); | 831 current_tab->OnSavePage(); |
832 } | 832 } |
833 | 833 |
834 bool CanSavePage(const Browser* browser) { | 834 bool CanSavePage(const Browser* browser) { |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1288 browser->host_desktop_type())); | 1288 browser->host_desktop_type())); |
1289 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1289 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
1290 | 1290 |
1291 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1291 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
1292 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1292 contents->GetRenderViewHost()->SyncRendererPrefs(); |
1293 app_browser->window()->Show(); | 1293 app_browser->window()->Show(); |
1294 } | 1294 } |
1295 #endif // defined(ENABLE_EXTENSIONS) | 1295 #endif // defined(ENABLE_EXTENSIONS) |
1296 | 1296 |
1297 } // namespace chrome | 1297 } // namespace chrome |
OLD | NEW |