| 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/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "chrome/app/chrome_command_ids.h" | 11 #include "chrome/app/chrome_command_ids.h" |
| 12 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 12 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 14 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 14 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| 15 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 15 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
| 16 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" | 16 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" |
| 17 #include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h" |
| 17 #include "chrome/browser/chrome_notification_types.h" | 18 #include "chrome/browser/chrome_notification_types.h" |
| 18 #include "chrome/browser/devtools/devtools_window.h" | 19 #include "chrome/browser/devtools/devtools_window.h" |
| 19 #include "chrome/browser/dom_distiller/tab_utils.h" | 20 #include "chrome/browser/dom_distiller/tab_utils.h" |
| 20 #include "chrome/browser/lifetime/application_lifetime.h" | 21 #include "chrome/browser/lifetime/application_lifetime.h" |
| 21 #include "chrome/browser/media/router/media_router_feature.h" | 22 #include "chrome/browser/media/router/media_router_feature.h" |
| 22 #include "chrome/browser/platform_util.h" | 23 #include "chrome/browser/platform_util.h" |
| 23 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 24 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 24 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
| 25 #include "chrome/browser/sessions/session_service_factory.h" | 26 #include "chrome/browser/sessions/session_service_factory.h" |
| 26 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 27 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
| (...skipping 1167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1194 void ToggleFullscreenMode(Browser* browser) { | 1195 void ToggleFullscreenMode(Browser* browser) { |
| 1195 DCHECK(browser); | 1196 DCHECK(browser); |
| 1196 browser->exclusive_access_manager() | 1197 browser->exclusive_access_manager() |
| 1197 ->fullscreen_controller() | 1198 ->fullscreen_controller() |
| 1198 ->ToggleBrowserFullscreenMode(); | 1199 ->ToggleBrowserFullscreenMode(); |
| 1199 } | 1200 } |
| 1200 | 1201 |
| 1201 void ClearCache(Browser* browser) { | 1202 void ClearCache(Browser* browser) { |
| 1202 BrowsingDataRemover* remover = | 1203 BrowsingDataRemover* remover = |
| 1203 BrowsingDataRemoverFactory::GetForBrowserContext(browser->profile()); | 1204 BrowsingDataRemoverFactory::GetForBrowserContext(browser->profile()); |
| 1204 remover->Remove(base::Time(), base::Time::Max(), | 1205 remover->Remove( |
| 1205 BrowsingDataRemover::REMOVE_CACHE, | 1206 base::Time(), base::Time::Max(), |
| 1206 BrowsingDataHelper::UNPROTECTED_WEB); | 1207 ChromeBrowsingDataRemoverDelegate::DATA_TYPE_CACHE, |
| 1208 ChromeBrowsingDataRemoverDelegate::ORIGIN_TYPE_UNPROTECTED_WEB); |
| 1207 // BrowsingDataRemover takes care of deleting itself when done. | 1209 // BrowsingDataRemover takes care of deleting itself when done. |
| 1208 } | 1210 } |
| 1209 | 1211 |
| 1210 bool IsDebuggerAttachedToCurrentTab(Browser* browser) { | 1212 bool IsDebuggerAttachedToCurrentTab(Browser* browser) { |
| 1211 WebContents* contents = browser->tab_strip_model()->GetActiveWebContents(); | 1213 WebContents* contents = browser->tab_strip_model()->GetActiveWebContents(); |
| 1212 return contents ? | 1214 return contents ? |
| 1213 content::DevToolsAgentHost::IsDebuggerAttached(contents) : false; | 1215 content::DevToolsAgentHost::IsDebuggerAttached(contents) : false; |
| 1214 } | 1216 } |
| 1215 | 1217 |
| 1216 void ViewSource(Browser* browser, WebContents* contents) { | 1218 void ViewSource(Browser* browser, WebContents* contents) { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1340 true)); | 1342 true)); |
| 1341 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1343 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
| 1342 | 1344 |
| 1343 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1345 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
| 1344 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1346 contents->GetRenderViewHost()->SyncRendererPrefs(); |
| 1345 app_browser->window()->Show(); | 1347 app_browser->window()->Show(); |
| 1346 } | 1348 } |
| 1347 #endif // BUILDFLAG(ENABLE_EXTENSIONS) | 1349 #endif // BUILDFLAG(ENABLE_EXTENSIONS) |
| 1348 | 1350 |
| 1349 } // namespace chrome | 1351 } // namespace chrome |
| OLD | NEW |