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/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "chrome/browser/profiles/profile.h" | 31 #include "chrome/browser/profiles/profile.h" |
32 #include "chrome/browser/rlz/rlz.h" | 32 #include "chrome/browser/rlz/rlz.h" |
33 #include "chrome/browser/sessions/session_service_factory.h" | 33 #include "chrome/browser/sessions/session_service_factory.h" |
34 #include "chrome/browser/sessions/tab_restore_service.h" | 34 #include "chrome/browser/sessions/tab_restore_service.h" |
35 #include "chrome/browser/sessions/tab_restore_service_delegate.h" | 35 #include "chrome/browser/sessions/tab_restore_service_delegate.h" |
36 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 36 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
37 #include "chrome/browser/ui/bookmarks/bookmark_prompt_controller.h" | 37 #include "chrome/browser/ui/bookmarks/bookmark_prompt_controller.h" |
38 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" | 38 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" |
39 #include "chrome/browser/ui/browser.h" | 39 #include "chrome/browser/ui/browser.h" |
40 #include "chrome/browser/ui/browser_command_controller.h" | 40 #include "chrome/browser/ui/browser_command_controller.h" |
| 41 #include "chrome/browser/ui/browser_dialogs.h" |
41 #include "chrome/browser/ui/browser_finder.h" | 42 #include "chrome/browser/ui/browser_finder.h" |
42 #include "chrome/browser/ui/browser_instant_controller.h" | 43 #include "chrome/browser/ui/browser_instant_controller.h" |
43 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" | 44 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" |
44 #include "chrome/browser/ui/browser_tabstrip.h" | 45 #include "chrome/browser/ui/browser_tabstrip.h" |
45 #include "chrome/browser/ui/browser_window.h" | 46 #include "chrome/browser/ui/browser_window.h" |
46 #include "chrome/browser/ui/chrome_pages.h" | 47 #include "chrome/browser/ui/chrome_pages.h" |
47 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 48 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
48 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 49 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
49 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" | 50 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" |
50 #include "chrome/browser/ui/omnibox/location_bar.h" | 51 #include "chrome/browser/ui/omnibox/location_bar.h" |
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 #if defined(OS_WIN) | 880 #if defined(OS_WIN) |
880 // In metro we can't display the task manager, as it is a native window. | 881 // In metro we can't display the task manager, as it is a native window. |
881 return !win8::IsSingleWindowMetroMode(); | 882 return !win8::IsSingleWindowMetroMode(); |
882 #else | 883 #else |
883 return true; | 884 return true; |
884 #endif | 885 #endif |
885 } | 886 } |
886 | 887 |
887 void OpenTaskManager(Browser* browser, bool highlight_background_resources) { | 888 void OpenTaskManager(Browser* browser, bool highlight_background_resources) { |
888 content::RecordAction(UserMetricsAction("TaskManager")); | 889 content::RecordAction(UserMetricsAction("TaskManager")); |
889 if (highlight_background_resources) | 890 chrome::ShowTaskManager(browser, highlight_background_resources); |
890 browser->window()->ShowBackgroundPages(); | |
891 else | |
892 browser->window()->ShowTaskManager(); | |
893 } | 891 } |
894 | 892 |
895 void OpenFeedbackDialog(Browser* browser) { | 893 void OpenFeedbackDialog(Browser* browser) { |
896 content::RecordAction(UserMetricsAction("Feedback")); | 894 content::RecordAction(UserMetricsAction("Feedback")); |
897 chrome::ShowFeedbackPage(browser, std::string(), std::string()); | 895 chrome::ShowFeedbackPage(browser, std::string(), std::string()); |
898 } | 896 } |
899 | 897 |
900 void ToggleBookmarkBar(Browser* browser) { | 898 void ToggleBookmarkBar(Browser* browser) { |
901 content::RecordAction(UserMetricsAction("ShowBookmarksBar")); | 899 content::RecordAction(UserMetricsAction("ShowBookmarksBar")); |
902 browser->window()->ToggleBookmarkBar(); | 900 browser->window()->ToggleBookmarkBar(); |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(), | 1094 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(), |
1097 browser->host_desktop_type())); | 1095 browser->host_desktop_type())); |
1098 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1096 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
1099 | 1097 |
1100 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1098 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
1101 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1099 contents->GetRenderViewHost()->SyncRendererPrefs(); |
1102 app_browser->window()->Show(); | 1100 app_browser->window()->Show(); |
1103 } | 1101 } |
1104 | 1102 |
1105 } // namespace chrome | 1103 } // namespace chrome |
OLD | NEW |