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_dialog_controller.h" // nogn
check | 22 #include "chrome/browser/media/router/media_router_dialog_controller.h" // nogn
check |
24 #include "chrome/browser/media/router/media_router_feature.h" | 23 #include "chrome/browser/media/router/media_router_feature.h" |
25 #include "chrome/browser/platform_util.h" | 24 #include "chrome/browser/platform_util.h" |
26 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 25 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
27 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 #include "components/prefs/pref_service.h" | 65 #include "components/prefs/pref_service.h" |
67 #include "components/security_state/core/security_state.h" | 66 #include "components/security_state/core/security_state.h" |
68 #include "components/sessions/core/live_tab_context.h" | 67 #include "components/sessions/core/live_tab_context.h" |
69 #include "components/sessions/core/tab_restore_service.h" | 68 #include "components/sessions/core/tab_restore_service.h" |
70 #include "components/signin/core/browser/signin_header_helper.h" | 69 #include "components/signin/core/browser/signin_header_helper.h" |
71 #include "components/translate/core/browser/language_state.h" | 70 #include "components/translate/core/browser/language_state.h" |
72 #include "components/version_info/version_info.h" | 71 #include "components/version_info/version_info.h" |
73 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 72 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
74 #include "components/zoom/page_zoom.h" | 73 #include "components/zoom/page_zoom.h" |
75 #include "components/zoom/zoom_controller.h" | 74 #include "components/zoom/zoom_controller.h" |
| 75 #include "content/public/browser/browsing_data_remover.h" |
76 #include "content/public/browser/devtools_agent_host.h" | 76 #include "content/public/browser/devtools_agent_host.h" |
77 #include "content/public/browser/navigation_controller.h" | 77 #include "content/public/browser/navigation_controller.h" |
78 #include "content/public/browser/navigation_entry.h" | 78 #include "content/public/browser/navigation_entry.h" |
79 #include "content/public/browser/notification_service.h" | 79 #include "content/public/browser/notification_service.h" |
80 #include "content/public/browser/page_navigator.h" | 80 #include "content/public/browser/page_navigator.h" |
81 #include "content/public/browser/render_view_host.h" | 81 #include "content/public/browser/render_view_host.h" |
82 #include "content/public/browser/render_widget_host_view.h" | 82 #include "content/public/browser/render_widget_host_view.h" |
83 #include "content/public/browser/web_contents.h" | 83 #include "content/public/browser/web_contents.h" |
84 #include "content/public/common/page_state.h" | 84 #include "content/public/common/page_state.h" |
85 #include "content/public/common/renderer_preferences.h" | 85 #include "content/public/common/renderer_preferences.h" |
(...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1181 } | 1181 } |
1182 | 1182 |
1183 void ToggleFullscreenMode(Browser* browser) { | 1183 void ToggleFullscreenMode(Browser* browser) { |
1184 DCHECK(browser); | 1184 DCHECK(browser); |
1185 browser->exclusive_access_manager() | 1185 browser->exclusive_access_manager() |
1186 ->fullscreen_controller() | 1186 ->fullscreen_controller() |
1187 ->ToggleBrowserFullscreenMode(); | 1187 ->ToggleBrowserFullscreenMode(); |
1188 } | 1188 } |
1189 | 1189 |
1190 void ClearCache(Browser* browser) { | 1190 void ClearCache(Browser* browser) { |
1191 BrowsingDataRemover* remover = | 1191 content::BrowsingDataRemover* remover = |
1192 BrowsingDataRemoverFactory::GetForBrowserContext(browser->profile()); | 1192 content::BrowserContext::GetBrowsingDataRemover(browser->profile()); |
1193 remover->Remove(base::Time(), base::Time::Max(), | 1193 remover->Remove(base::Time(), base::Time::Max(), |
1194 BrowsingDataRemover::DATA_TYPE_CACHE, | 1194 content::BrowsingDataRemover::DATA_TYPE_CACHE, |
1195 BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB); | 1195 content::BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB); |
1196 // BrowsingDataRemover takes care of deleting itself when done. | 1196 // BrowsingDataRemover takes care of deleting itself when done. |
1197 } | 1197 } |
1198 | 1198 |
1199 bool IsDebuggerAttachedToCurrentTab(Browser* browser) { | 1199 bool IsDebuggerAttachedToCurrentTab(Browser* browser) { |
1200 WebContents* contents = browser->tab_strip_model()->GetActiveWebContents(); | 1200 WebContents* contents = browser->tab_strip_model()->GetActiveWebContents(); |
1201 return contents ? | 1201 return contents ? |
1202 content::DevToolsAgentHost::IsDebuggerAttached(contents) : false; | 1202 content::DevToolsAgentHost::IsDebuggerAttached(contents) : false; |
1203 } | 1203 } |
1204 | 1204 |
1205 void ViewSource(Browser* browser, WebContents* contents) { | 1205 void ViewSource(Browser* browser, WebContents* contents) { |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1297 } | 1297 } |
1298 | 1298 |
1299 bool CanCreateBookmarkApp(const Browser* browser) { | 1299 bool CanCreateBookmarkApp(const Browser* browser) { |
1300 return extensions::TabHelper::FromWebContents( | 1300 return extensions::TabHelper::FromWebContents( |
1301 browser->tab_strip_model()->GetActiveWebContents()) | 1301 browser->tab_strip_model()->GetActiveWebContents()) |
1302 ->CanCreateBookmarkApp(); | 1302 ->CanCreateBookmarkApp(); |
1303 } | 1303 } |
1304 #endif // BUILDFLAG(ENABLE_EXTENSIONS) | 1304 #endif // BUILDFLAG(ENABLE_EXTENSIONS) |
1305 | 1305 |
1306 } // namespace chrome | 1306 } // namespace chrome |
OLD | NEW |