OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/bookmarks/bookmark_editor.h" | 10 #include "chrome/browser/bookmarks/bookmark_editor.h" |
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 | 852 |
853 void OpenUpdateChromeDialog(Browser* browser) { | 853 void OpenUpdateChromeDialog(Browser* browser) { |
854 content::RecordAction(UserMetricsAction("UpdateChrome")); | 854 content::RecordAction(UserMetricsAction("UpdateChrome")); |
855 browser->window()->ShowUpdateChromeDialog(); | 855 browser->window()->ShowUpdateChromeDialog(); |
856 } | 856 } |
857 | 857 |
858 void ToggleSpeechInput(Browser* browser) { | 858 void ToggleSpeechInput(Browser* browser) { |
859 GetActiveWebContents(browser)->GetRenderViewHost()->ToggleSpeechInput(); | 859 GetActiveWebContents(browser)->GetRenderViewHost()->ToggleSpeechInput(); |
860 } | 860 } |
861 | 861 |
| 862 void SelectPreviousMRUTab(Browser* browser) { |
| 863 if (!browser->mru_tab_controller()) |
| 864 return; |
| 865 |
| 866 TabContents* contents = browser->mru_tab_controller()->GetPreviousMRUTab(); |
| 867 if (contents) |
| 868 ActivateTabAt(browser, |
| 869 browser->tab_strip_model()->GetIndexOfTabContents(contents), |
| 870 true); |
| 871 } |
| 872 |
862 void ToggleFullscreenMode(Browser* browser) { | 873 void ToggleFullscreenMode(Browser* browser) { |
863 browser->fullscreen_controller()->ToggleFullscreenMode(); | 874 browser->fullscreen_controller()->ToggleFullscreenMode(); |
864 } | 875 } |
865 | 876 |
866 void ClearCache(Browser* browser) { | 877 void ClearCache(Browser* browser) { |
867 BrowsingDataRemover* remover = new BrowsingDataRemover(browser->profile(), | 878 BrowsingDataRemover* remover = new BrowsingDataRemover(browser->profile(), |
868 BrowsingDataRemover::EVERYTHING, | 879 BrowsingDataRemover::EVERYTHING, |
869 base::Time()); | 880 base::Time()); |
870 remover->Remove(BrowsingDataRemover::REMOVE_CACHE, | 881 remover->Remove(BrowsingDataRemover::REMOVE_CACHE, |
871 BrowsingDataHelper::UNPROTECTED_WEB); | 882 BrowsingDataHelper::UNPROTECTED_WEB); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
984 if (!tab_contents) | 995 if (!tab_contents) |
985 tab_contents = new TabContents(contents); | 996 tab_contents = new TabContents(contents); |
986 app_browser->tab_strip_model()->AppendTabContents(tab_contents, true); | 997 app_browser->tab_strip_model()->AppendTabContents(tab_contents, true); |
987 | 998 |
988 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 999 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
989 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1000 contents->GetRenderViewHost()->SyncRendererPrefs(); |
990 app_browser->window()->Show(); | 1001 app_browser->window()->Show(); |
991 } | 1002 } |
992 | 1003 |
993 } // namespace chrome | 1004 } // namespace chrome |
OLD | NEW |