| 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/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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 return new_tab; | 207 return new_tab; |
| 208 } | 208 } |
| 209 default: | 209 default: |
| 210 browser->window()->GetLocationBar()->Revert(); | 210 browser->window()->GetLocationBar()->Revert(); |
| 211 return current_tab; | 211 return current_tab; |
| 212 } | 212 } |
| 213 } | 213 } |
| 214 | 214 |
| 215 void ReloadInternal(Browser* browser, | 215 void ReloadInternal(Browser* browser, |
| 216 WindowOpenDisposition disposition, | 216 WindowOpenDisposition disposition, |
| 217 bool ignore_cache) { | 217 bool bypass_cache) { |
| 218 // As this is caused by a user action, give the focus to the page. | 218 // As this is caused by a user action, give the focus to the page. |
| 219 // | 219 // |
| 220 // Also notify RenderViewHostDelegate of the user gesture; this is | 220 // Also notify RenderViewHostDelegate of the user gesture; this is |
| 221 // normally done in Browser::Navigate, but a reload bypasses Navigate. | 221 // normally done in Browser::Navigate, but a reload bypasses Navigate. |
| 222 WebContents* new_tab = GetTabAndRevertIfNecessary(browser, disposition); | 222 WebContents* new_tab = GetTabAndRevertIfNecessary(browser, disposition); |
| 223 new_tab->UserGestureDone(); | 223 new_tab->UserGestureDone(); |
| 224 if (!new_tab->FocusLocationBarByDefault()) | 224 if (!new_tab->FocusLocationBarByDefault()) |
| 225 new_tab->Focus(); | 225 new_tab->Focus(); |
| 226 | 226 |
| 227 DevToolsWindow* devtools = | 227 DevToolsWindow* devtools = |
| 228 DevToolsWindow::GetInstanceForInspectedWebContents(new_tab); | 228 DevToolsWindow::GetInstanceForInspectedWebContents(new_tab); |
| 229 if (devtools && devtools->ReloadInspectedWebContents(ignore_cache)) | 229 if (devtools && devtools->ReloadInspectedWebContents(bypass_cache)) |
| 230 return; | 230 return; |
| 231 | 231 |
| 232 if (ignore_cache) | 232 if (bypass_cache) |
| 233 new_tab->GetController().ReloadBypassingCache(true); | 233 new_tab->GetController().ReloadBypassingCache(true); |
| 234 else | 234 else |
| 235 new_tab->GetController().Reload(true); | 235 new_tab->GetController().Reload(true); |
| 236 } | 236 } |
| 237 | 237 |
| 238 bool IsShowingWebContentsModalDialog(Browser* browser) { | 238 bool IsShowingWebContentsModalDialog(Browser* browser) { |
| 239 WebContents* web_contents = | 239 WebContents* web_contents = |
| 240 browser->tab_strip_model()->GetActiveWebContents(); | 240 browser->tab_strip_model()->GetActiveWebContents(); |
| 241 if (!web_contents) | 241 if (!web_contents) |
| 242 return false; | 242 return false; |
| (...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1286 app_name, true /* trusted_source */, gfx::Rect(), browser->profile())); | 1286 app_name, true /* trusted_source */, gfx::Rect(), browser->profile())); |
| 1287 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1287 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
| 1288 | 1288 |
| 1289 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1289 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
| 1290 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1290 contents->GetRenderViewHost()->SyncRendererPrefs(); |
| 1291 app_browser->window()->Show(); | 1291 app_browser->window()->Show(); |
| 1292 } | 1292 } |
| 1293 #endif // defined(ENABLE_EXTENSIONS) | 1293 #endif // defined(ENABLE_EXTENSIONS) |
| 1294 | 1294 |
| 1295 } // namespace chrome | 1295 } // namespace chrome |
| OLD | NEW |