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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 233 WindowOpenDisposition disposition, | 233 WindowOpenDisposition disposition, |
| 234 bool ignore_cache) { | 234 bool ignore_cache) { |
| 235 // As this is caused by a user action, give the focus to the page. | 235 // As this is caused by a user action, give the focus to the page. |
| 236 // | 236 // |
| 237 // Also notify RenderViewHostDelegate of the user gesture; this is | 237 // Also notify RenderViewHostDelegate of the user gesture; this is |
| 238 // normally done in Browser::Navigate, but a reload bypasses Navigate. | 238 // normally done in Browser::Navigate, but a reload bypasses Navigate. |
| 239 WebContents* new_tab = GetTabAndRevertIfNecessary(browser, disposition); | 239 WebContents* new_tab = GetTabAndRevertIfNecessary(browser, disposition); |
| 240 new_tab->UserGestureDone(); | 240 new_tab->UserGestureDone(); |
| 241 if (!new_tab->FocusLocationBarByDefault()) | 241 if (!new_tab->FocusLocationBarByDefault()) |
| 242 new_tab->GetView()->Focus(); | 242 new_tab->GetView()->Focus(); |
| 243 | |
|
mmenke
2014/04/15 16:02:25
For simplicity, should just remove this change fro
Randy Smith (Not in Mondays)
2014/04/15 18:27:29
Don't you understand how much this line improves t
| |
| 243 if (ignore_cache) | 244 if (ignore_cache) |
| 244 new_tab->GetController().ReloadIgnoringCache(true); | 245 new_tab->GetController().ReloadIgnoringCache(true); |
| 245 else | 246 else |
| 246 new_tab->GetController().Reload(true); | 247 new_tab->GetController().Reload(true); |
| 247 } | 248 } |
| 248 | 249 |
| 249 bool IsShowingWebContentsModalDialog(const Browser* browser) { | 250 bool IsShowingWebContentsModalDialog(const Browser* browser) { |
| 250 WebContents* web_contents = | 251 WebContents* web_contents = |
| 251 browser->tab_strip_model()->GetActiveWebContents(); | 252 browser->tab_strip_model()->GetActiveWebContents(); |
| 252 if (!web_contents) | 253 if (!web_contents) |
| (...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1263 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(), | 1264 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(), |
| 1264 browser->host_desktop_type())); | 1265 browser->host_desktop_type())); |
| 1265 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1266 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
| 1266 | 1267 |
| 1267 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1268 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
| 1268 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1269 contents->GetRenderViewHost()->SyncRendererPrefs(); |
| 1269 app_browser->window()->Show(); | 1270 app_browser->window()->Show(); |
| 1270 } | 1271 } |
| 1271 | 1272 |
| 1272 } // namespace chrome | 1273 } // namespace chrome |
| OLD | NEW |