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" |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 WebContents* new_tab = GetTabAndRevertIfNecessary(browser, disposition); | 257 WebContents* new_tab = GetTabAndRevertIfNecessary(browser, disposition); |
258 new_tab->UserGestureDone(); | 258 new_tab->UserGestureDone(); |
259 if (!new_tab->FocusLocationBarByDefault()) | 259 if (!new_tab->FocusLocationBarByDefault()) |
260 new_tab->Focus(); | 260 new_tab->Focus(); |
261 | 261 |
262 DevToolsWindow* devtools = | 262 DevToolsWindow* devtools = |
263 DevToolsWindow::GetInstanceForInspectedWebContents(new_tab); | 263 DevToolsWindow::GetInstanceForInspectedWebContents(new_tab); |
264 if (devtools && devtools->ReloadInspectedWebContents(bypass_cache)) | 264 if (devtools && devtools->ReloadInspectedWebContents(bypass_cache)) |
265 return; | 265 return; |
266 | 266 |
267 if (bypass_cache) | 267 new_tab->GetController().Reload(bypass_cache |
268 new_tab->GetController().Reload(true, content::ReloadType::BYPASSING_CACHE); | 268 ? content::ReloadType::BYPASSING_CACHE |
269 else | 269 : content::ReloadType::NORMAL, |
270 new_tab->GetController().Reload(true); | 270 true); |
271 } | 271 } |
272 | 272 |
273 bool IsShowingWebContentsModalDialog(Browser* browser) { | 273 bool IsShowingWebContentsModalDialog(Browser* browser) { |
274 WebContents* web_contents = | 274 WebContents* web_contents = |
275 browser->tab_strip_model()->GetActiveWebContents(); | 275 browser->tab_strip_model()->GetActiveWebContents(); |
276 if (!web_contents) | 276 if (!web_contents) |
277 return false; | 277 return false; |
278 | 278 |
279 // TODO(gbillock): This is currently called in production by the CanPrint | 279 // TODO(gbillock): This is currently called in production by the CanPrint |
280 // method, and may be too restrictive if we allow print preview to overlap. | 280 // method, and may be too restrictive if we allow print preview to overlap. |
(...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1173 if (!entry) | 1173 if (!entry) |
1174 return; | 1174 return; |
1175 if (entry->GetIsOverridingUserAgent()) { | 1175 if (entry->GetIsOverridingUserAgent()) { |
1176 entry->SetIsOverridingUserAgent(false); | 1176 entry->SetIsOverridingUserAgent(false); |
1177 } else { | 1177 } else { |
1178 entry->SetIsOverridingUserAgent(true); | 1178 entry->SetIsOverridingUserAgent(true); |
1179 std::string product = version_info::GetProductNameAndVersionForUserAgent(); | 1179 std::string product = version_info::GetProductNameAndVersionForUserAgent(); |
1180 current_tab->SetUserAgentOverride(content::BuildUserAgentFromOSAndProduct( | 1180 current_tab->SetUserAgentOverride(content::BuildUserAgentFromOSAndProduct( |
1181 kOsOverrideForTabletSite, product)); | 1181 kOsOverrideForTabletSite, product)); |
1182 } | 1182 } |
1183 controller.ReloadOriginalRequestURL(true); | 1183 controller.Reload(content::ReloadType::ORIGINAL_REQUEST_URL, true); |
1184 } | 1184 } |
1185 | 1185 |
1186 void ToggleFullscreenMode(Browser* browser) { | 1186 void ToggleFullscreenMode(Browser* browser) { |
1187 DCHECK(browser); | 1187 DCHECK(browser); |
1188 browser->exclusive_access_manager() | 1188 browser->exclusive_access_manager() |
1189 ->fullscreen_controller() | 1189 ->fullscreen_controller() |
1190 ->ToggleBrowserFullscreenMode(); | 1190 ->ToggleBrowserFullscreenMode(); |
1191 } | 1191 } |
1192 | 1192 |
1193 void ClearCache(Browser* browser) { | 1193 void ClearCache(Browser* browser) { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1331 app_name, true /* trusted_source */, gfx::Rect(), browser->profile())); | 1331 app_name, true /* trusted_source */, gfx::Rect(), browser->profile())); |
1332 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1332 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
1333 | 1333 |
1334 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1334 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
1335 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1335 contents->GetRenderViewHost()->SyncRendererPrefs(); |
1336 app_browser->window()->Show(); | 1336 app_browser->window()->Show(); |
1337 } | 1337 } |
1338 #endif // BUILDFLAG(ENABLE_EXTENSIONS) | 1338 #endif // BUILDFLAG(ENABLE_EXTENSIONS) |
1339 | 1339 |
1340 } // namespace chrome | 1340 } // namespace chrome |
OLD | NEW |