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/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 void ReloadInternal(Browser* browser, | 161 void ReloadInternal(Browser* browser, |
162 WindowOpenDisposition disposition, | 162 WindowOpenDisposition disposition, |
163 bool ignore_cache) { | 163 bool ignore_cache) { |
164 // As this is caused by a user action, give the focus to the page. | 164 // As this is caused by a user action, give the focus to the page. |
165 // | 165 // |
166 // Also notify RenderViewHostDelegate of the user gesture; this is | 166 // Also notify RenderViewHostDelegate of the user gesture; this is |
167 // normally done in Browser::Navigate, but a reload bypasses Navigate. | 167 // normally done in Browser::Navigate, but a reload bypasses Navigate. |
168 WebContents* web_contents = GetOrCloneTabForDisposition(browser, disposition); | 168 WebContents* web_contents = GetOrCloneTabForDisposition(browser, disposition); |
169 web_contents->UserGestureDone(); | 169 web_contents->UserGestureDone(); |
170 if (!web_contents->FocusLocationBarByDefault()) | 170 if (!web_contents->FocusLocationBarByDefault()) |
171 web_contents->Focus(); | 171 web_contents->GetView()->Focus(); |
172 if (ignore_cache) | 172 if (ignore_cache) |
173 web_contents->GetController().ReloadIgnoringCache(true); | 173 web_contents->GetController().ReloadIgnoringCache(true); |
174 else | 174 else |
175 web_contents->GetController().Reload(true); | 175 web_contents->GetController().Reload(true); |
176 } | 176 } |
177 | 177 |
178 bool IsShowingWebContentsModalDialog(const Browser* browser) { | 178 bool IsShowingWebContentsModalDialog(const Browser* browser) { |
179 WebContents* web_contents = | 179 WebContents* web_contents = |
180 browser->tab_strip_model()->GetActiveWebContents(); | 180 browser->tab_strip_model()->GetActiveWebContents(); |
181 if (!web_contents) | 181 if (!web_contents) |
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1093 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(), | 1093 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(), |
1094 browser->host_desktop_type())); | 1094 browser->host_desktop_type())); |
1095 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1095 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
1096 | 1096 |
1097 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1097 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
1098 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1098 contents->GetRenderViewHost()->SyncRendererPrefs(); |
1099 app_browser->window()->Show(); | 1099 app_browser->window()->Show(); |
1100 } | 1100 } |
1101 | 1101 |
1102 } // namespace chrome | 1102 } // namespace chrome |
OLD | NEW |