OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/bookmarks/bookmark_editor.h" | 10 #include "chrome/browser/bookmarks/bookmark_editor.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "chrome/browser/printing/print_preview_tab_controller.h" | 24 #include "chrome/browser/printing/print_preview_tab_controller.h" |
25 #include "chrome/browser/printing/print_view_manager.h" | 25 #include "chrome/browser/printing/print_view_manager.h" |
26 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
27 #include "chrome/browser/sessions/session_service_factory.h" | 27 #include "chrome/browser/sessions/session_service_factory.h" |
28 #include "chrome/browser/sessions/tab_restore_service.h" | 28 #include "chrome/browser/sessions/tab_restore_service.h" |
29 #include "chrome/browser/sessions/tab_restore_service_delegate.h" | 29 #include "chrome/browser/sessions/tab_restore_service_delegate.h" |
30 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 30 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
31 #include "chrome/browser/ui/browser.h" | 31 #include "chrome/browser/ui/browser.h" |
32 #include "chrome/browser/ui/browser_command_controller.h" | 32 #include "chrome/browser/ui/browser_command_controller.h" |
33 #include "chrome/browser/ui/browser_finder.h" | 33 #include "chrome/browser/ui/browser_finder.h" |
| 34 #include "chrome/browser/ui/browser_instant_controller.h" |
34 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" | 35 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" |
35 #include "chrome/browser/ui/browser_tabstrip.h" | 36 #include "chrome/browser/ui/browser_tabstrip.h" |
36 #include "chrome/browser/ui/browser_window.h" | 37 #include "chrome/browser/ui/browser_window.h" |
37 #include "chrome/browser/ui/constrained_window_tab_helper.h" | 38 #include "chrome/browser/ui/constrained_window_tab_helper.h" |
38 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 39 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
39 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 40 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
40 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" | 41 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" |
41 #include "chrome/browser/ui/omnibox/location_bar.h" | 42 #include "chrome/browser/ui/omnibox/location_bar.h" |
42 #include "chrome/browser/ui/search/search.h" | 43 #include "chrome/browser/ui/search/search.h" |
43 #include "chrome/browser/ui/search/search_model.h" | 44 #include "chrome/browser/ui/search/search_model.h" |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 } | 336 } |
336 | 337 |
337 void OpenCurrentURL(Browser* browser) { | 338 void OpenCurrentURL(Browser* browser) { |
338 content::RecordAction(UserMetricsAction("LoadURL")); | 339 content::RecordAction(UserMetricsAction("LoadURL")); |
339 LocationBar* location_bar = browser->window()->GetLocationBar(); | 340 LocationBar* location_bar = browser->window()->GetLocationBar(); |
340 if (!location_bar) | 341 if (!location_bar) |
341 return; | 342 return; |
342 | 343 |
343 WindowOpenDisposition open_disposition = | 344 WindowOpenDisposition open_disposition = |
344 location_bar->GetWindowOpenDisposition(); | 345 location_bar->GetWindowOpenDisposition(); |
345 if (browser->OpenInstant(open_disposition)) | 346 if (browser->instant_controller()->OpenInstant(open_disposition)) |
346 return; | 347 return; |
347 | 348 |
348 GURL url(location_bar->GetInputString()); | 349 GURL url(location_bar->GetInputString()); |
349 | 350 |
350 NavigateParams params(browser, url, location_bar->GetPageTransition()); | 351 NavigateParams params(browser, url, location_bar->GetPageTransition()); |
351 params.disposition = open_disposition; | 352 params.disposition = open_disposition; |
352 // Use ADD_INHERIT_OPENER so that all pages opened by the omnibox at least | 353 // Use ADD_INHERIT_OPENER so that all pages opened by the omnibox at least |
353 // inherit the opener. In some cases the tabstrip will determine the group | 354 // inherit the opener. In some cases the tabstrip will determine the group |
354 // should be inherited, in which case the group is inherited instead of the | 355 // should be inherited, in which case the group is inherited instead of the |
355 // opener. | 356 // opener. |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1011 if (!tab_contents) | 1012 if (!tab_contents) |
1012 tab_contents = new TabContents(contents); | 1013 tab_contents = new TabContents(contents); |
1013 app_browser->tab_strip_model()->AppendTabContents(tab_contents, true); | 1014 app_browser->tab_strip_model()->AppendTabContents(tab_contents, true); |
1014 | 1015 |
1015 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1016 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
1016 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1017 contents->GetRenderViewHost()->SyncRendererPrefs(); |
1017 app_browser->window()->Show(); | 1018 app_browser->window()->Show(); |
1018 } | 1019 } |
1019 | 1020 |
1020 } // namespace chrome | 1021 } // namespace chrome |
OLD | NEW |