Chromium Code Reviews| 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.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 209 WindowOpenDisposition disposition, | 209 WindowOpenDisposition disposition, |
| 210 bool ignore_cache) { | 210 bool ignore_cache) { |
| 211 // As this is caused by a user action, give the focus to the page. | 211 // As this is caused by a user action, give the focus to the page. |
| 212 // | 212 // |
| 213 // Also notify RenderViewHostDelegate of the user gesture; this is | 213 // Also notify RenderViewHostDelegate of the user gesture; this is |
| 214 // normally done in Browser::Navigate, but a reload bypasses Navigate. | 214 // normally done in Browser::Navigate, but a reload bypasses Navigate. |
| 215 WebContents* new_tab = GetTabAndRevertIfNecessary(browser, disposition); | 215 WebContents* new_tab = GetTabAndRevertIfNecessary(browser, disposition); |
| 216 new_tab->UserGestureDone(); | 216 new_tab->UserGestureDone(); |
| 217 if (!new_tab->FocusLocationBarByDefault()) | 217 if (!new_tab->FocusLocationBarByDefault()) |
| 218 new_tab->Focus(); | 218 new_tab->Focus(); |
| 219 | |
| 220 if (DevToolsWindow* devtools = | |
| 221 DevToolsWindow::GetInstanceForInspectedWebContents(new_tab)) { | |
| 222 devtools->ReloadInspectedWebContents(ignore_cache); | |
|
sky
2015/08/14 20:04:31
nit: spacing is off.
dgozman
2015/08/14 23:57:34
Done.
| |
| 223 return; | |
| 224 } | |
| 225 | |
| 219 if (ignore_cache) | 226 if (ignore_cache) |
| 220 new_tab->GetController().ReloadIgnoringCache(true); | 227 new_tab->GetController().ReloadIgnoringCache(true); |
| 221 else | 228 else |
| 222 new_tab->GetController().Reload(true); | 229 new_tab->GetController().Reload(true); |
| 223 } | 230 } |
| 224 | 231 |
| 225 bool IsShowingWebContentsModalDialog(Browser* browser) { | 232 bool IsShowingWebContentsModalDialog(Browser* browser) { |
| 226 WebContents* web_contents = | 233 WebContents* web_contents = |
| 227 browser->tab_strip_model()->GetActiveWebContents(); | 234 browser->tab_strip_model()->GetActiveWebContents(); |
| 228 if (!web_contents) | 235 if (!web_contents) |
| (...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1277 browser->host_desktop_type())); | 1284 browser->host_desktop_type())); |
| 1278 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1285 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
| 1279 | 1286 |
| 1280 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1287 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
| 1281 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1288 contents->GetRenderViewHost()->SyncRendererPrefs(); |
| 1282 app_browser->window()->Show(); | 1289 app_browser->window()->Show(); |
| 1283 } | 1290 } |
| 1284 #endif // defined(ENABLE_EXTENSIONS) | 1291 #endif // defined(ENABLE_EXTENSIONS) |
| 1285 | 1292 |
| 1286 } // namespace chrome | 1293 } // namespace chrome |
| OLD | NEW |