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