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_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
9 #include "base/metrics/user_metrics.h" | 9 #include "base/metrics/user_metrics.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
12 #include "chrome/app/chrome_command_ids.h" | 12 #include "chrome/app/chrome_command_ids.h" |
13 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 13 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
14 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
15 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 15 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
16 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 16 |
17 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" | |
18 #include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h" | 17 #include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h" |
19 #include "chrome/browser/chrome_notification_types.h" | 18 #include "chrome/browser/chrome_notification_types.h" |
20 #include "chrome/browser/devtools/devtools_window.h" | 19 #include "chrome/browser/devtools/devtools_window.h" |
21 #include "chrome/browser/dom_distiller/tab_utils.h" | 20 #include "chrome/browser/dom_distiller/tab_utils.h" |
22 #include "chrome/browser/lifetime/application_lifetime.h" | 21 #include "chrome/browser/lifetime/application_lifetime.h" |
23 #include "chrome/browser/media/router/media_router_feature.h" | 22 #include "chrome/browser/media/router/media_router_feature.h" |
24 #include "chrome/browser/platform_util.h" | 23 #include "chrome/browser/platform_util.h" |
25 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 24 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
26 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
27 #include "chrome/browser/sessions/session_service_factory.h" | 26 #include "chrome/browser/sessions/session_service_factory.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 #include "components/prefs/pref_service.h" | 64 #include "components/prefs/pref_service.h" |
66 #include "components/security_state/core/security_state.h" | 65 #include "components/security_state/core/security_state.h" |
67 #include "components/sessions/core/live_tab_context.h" | 66 #include "components/sessions/core/live_tab_context.h" |
68 #include "components/sessions/core/tab_restore_service.h" | 67 #include "components/sessions/core/tab_restore_service.h" |
69 #include "components/signin/core/browser/signin_header_helper.h" | 68 #include "components/signin/core/browser/signin_header_helper.h" |
70 #include "components/translate/core/browser/language_state.h" | 69 #include "components/translate/core/browser/language_state.h" |
71 #include "components/version_info/version_info.h" | 70 #include "components/version_info/version_info.h" |
72 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 71 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
73 #include "components/zoom/page_zoom.h" | 72 #include "components/zoom/page_zoom.h" |
74 #include "components/zoom/zoom_controller.h" | 73 #include "components/zoom/zoom_controller.h" |
| 74 #include "content/public/browser/browsing_data_remover.h" |
75 #include "content/public/browser/devtools_agent_host.h" | 75 #include "content/public/browser/devtools_agent_host.h" |
76 #include "content/public/browser/navigation_controller.h" | 76 #include "content/public/browser/navigation_controller.h" |
77 #include "content/public/browser/navigation_entry.h" | 77 #include "content/public/browser/navigation_entry.h" |
78 #include "content/public/browser/notification_service.h" | 78 #include "content/public/browser/notification_service.h" |
79 #include "content/public/browser/page_navigator.h" | 79 #include "content/public/browser/page_navigator.h" |
80 #include "content/public/browser/render_view_host.h" | 80 #include "content/public/browser/render_view_host.h" |
81 #include "content/public/browser/render_widget_host_view.h" | 81 #include "content/public/browser/render_widget_host_view.h" |
82 #include "content/public/browser/web_contents.h" | 82 #include "content/public/browser/web_contents.h" |
83 #include "content/public/common/page_state.h" | 83 #include "content/public/common/page_state.h" |
84 #include "content/public/common/renderer_preferences.h" | 84 #include "content/public/common/renderer_preferences.h" |
(...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1186 } | 1186 } |
1187 | 1187 |
1188 void ToggleFullscreenMode(Browser* browser) { | 1188 void ToggleFullscreenMode(Browser* browser) { |
1189 DCHECK(browser); | 1189 DCHECK(browser); |
1190 browser->exclusive_access_manager() | 1190 browser->exclusive_access_manager() |
1191 ->fullscreen_controller() | 1191 ->fullscreen_controller() |
1192 ->ToggleBrowserFullscreenMode(); | 1192 ->ToggleBrowserFullscreenMode(); |
1193 } | 1193 } |
1194 | 1194 |
1195 void ClearCache(Browser* browser) { | 1195 void ClearCache(Browser* browser) { |
1196 BrowsingDataRemover* remover = | 1196 content::BrowsingDataRemover* remover = |
1197 BrowsingDataRemoverFactory::GetForBrowserContext(browser->profile()); | 1197 content::BrowserContext::GetBrowsingDataRemover(browser->profile()); |
1198 remover->Remove(base::Time(), base::Time::Max(), | 1198 remover->Remove(base::Time(), base::Time::Max(), |
1199 BrowsingDataRemover::DATA_TYPE_CACHE, | 1199 content::BrowsingDataRemover::DATA_TYPE_CACHE, |
1200 BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB); | 1200 content::BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB); |
1201 // BrowsingDataRemover takes care of deleting itself when done. | 1201 // BrowsingDataRemover takes care of deleting itself when done. |
1202 } | 1202 } |
1203 | 1203 |
1204 bool IsDebuggerAttachedToCurrentTab(Browser* browser) { | 1204 bool IsDebuggerAttachedToCurrentTab(Browser* browser) { |
1205 WebContents* contents = browser->tab_strip_model()->GetActiveWebContents(); | 1205 WebContents* contents = browser->tab_strip_model()->GetActiveWebContents(); |
1206 return contents ? | 1206 return contents ? |
1207 content::DevToolsAgentHost::IsDebuggerAttached(contents) : false; | 1207 content::DevToolsAgentHost::IsDebuggerAttached(contents) : false; |
1208 } | 1208 } |
1209 | 1209 |
1210 void ViewSource(Browser* browser, WebContents* contents) { | 1210 void ViewSource(Browser* browser, WebContents* contents) { |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1302 } | 1302 } |
1303 | 1303 |
1304 bool CanCreateBookmarkApp(const Browser* browser) { | 1304 bool CanCreateBookmarkApp(const Browser* browser) { |
1305 return extensions::TabHelper::FromWebContents( | 1305 return extensions::TabHelper::FromWebContents( |
1306 browser->tab_strip_model()->GetActiveWebContents()) | 1306 browser->tab_strip_model()->GetActiveWebContents()) |
1307 ->CanCreateBookmarkApp(); | 1307 ->CanCreateBookmarkApp(); |
1308 } | 1308 } |
1309 #endif // BUILDFLAG(ENABLE_EXTENSIONS) | 1309 #endif // BUILDFLAG(ENABLE_EXTENSIONS) |
1310 | 1310 |
1311 } // namespace chrome | 1311 } // namespace chrome |
OLD | NEW |