| 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" |
| 11 #include "chrome/browser/bookmarks/bookmark_model.h" | 11 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 12 #include "chrome/browser/bookmarks/bookmark_utils.h" | 12 #include "chrome/browser/bookmarks/bookmark_utils.h" |
| 13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 14 #include "chrome/browser/chrome_page_zoom.h" | 14 #include "chrome/browser/chrome_page_zoom.h" |
| 15 #include "chrome/browser/debugger/devtools_window.h" | 15 #include "chrome/browser/debugger/devtools_window.h" |
| 16 #include "chrome/browser/download/download_util.h" | 16 #include "chrome/browser/download/download_util.h" |
| 17 #include "chrome/browser/extensions/extension_service.h" | 17 #include "chrome/browser/extensions/extension_service.h" |
| 18 #include "chrome/browser/favicon/favicon_tab_helper.h" | 18 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| 19 #include "chrome/browser/lifetime/application_lifetime.h" | 19 #include "chrome/browser/lifetime/application_lifetime.h" |
| 20 #include "chrome/browser/platform_util.h" | 20 #include "chrome/browser/platform_util.h" |
| 21 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 21 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 22 #include "chrome/browser/prefs/pref_service.h" | 22 #include "chrome/browser/prefs/pref_service.h" |
| 23 #include "chrome/browser/printing/print_preview_tab_controller.h" | 23 #include "chrome/browser/printing/print_preview_tab_controller.h" |
| 24 #include "chrome/browser/printing/print_view_manager.h" | 24 #include "chrome/browser/printing/print_view_manager.h" |
| 25 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
| 26 #include "chrome/browser/sessions/session_service_factory.h" | 26 #include "chrome/browser/sessions/session_service_factory.h" |
| 27 #include "chrome/browser/sessions/tab_restore_service_factory.h" | |
| 28 #include "chrome/browser/sessions/tab_restore_service.h" | 27 #include "chrome/browser/sessions/tab_restore_service.h" |
| 29 #include "chrome/browser/sessions/tab_restore_service_delegate.h" | 28 #include "chrome/browser/sessions/tab_restore_service_delegate.h" |
| 29 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
| 30 #include "chrome/browser/ui/browser.h" | 30 #include "chrome/browser/ui/browser.h" |
| 31 #include "chrome/browser/ui/browser_command_controller.h" | 31 #include "chrome/browser/ui/browser_command_controller.h" |
| 32 #include "chrome/browser/ui/browser_finder.h" | 32 #include "chrome/browser/ui/browser_finder.h" |
| 33 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" | 33 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" |
| 34 #include "chrome/browser/ui/browser_tabstrip.h" | 34 #include "chrome/browser/ui/browser_tabstrip.h" |
| 35 #include "chrome/browser/ui/browser_window.h" | 35 #include "chrome/browser/ui/browser_window.h" |
| 36 #include "chrome/browser/ui/constrained_window_tab_helper.h" | 36 #include "chrome/browser/ui/constrained_window_tab_helper.h" |
| 37 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 37 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
| 38 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 38 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
| 39 #include "chrome/browser/ui/omnibox/location_bar.h" | 39 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 40 #include "chrome/browser/ui/search/search.h" | 40 #include "chrome/browser/ui/search/search.h" |
| 41 #include "chrome/browser/ui/search/search_model.h" | 41 #include "chrome/browser/ui/search/search_model.h" |
| 42 #include "chrome/browser/ui/status_bubble.h" | 42 #include "chrome/browser/ui/status_bubble.h" |
| 43 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 43 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 44 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 44 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 45 #include "chrome/browser/ui/webui/feedback_ui.h" | 45 #include "chrome/browser/ui/webui/feedback_ui.h" |
| 46 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" | 46 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" |
| 47 #include "chrome/browser/web_applications/web_app.h" | 47 #include "chrome/browser/web_applications/web_app.h" |
| 48 #include "chrome/common/chrome_switches.h" | 48 #include "chrome/common/chrome_switches.h" |
| 49 #include "chrome/common/pref_names.h" | 49 #include "chrome/common/pref_names.h" |
| 50 #include "content/public/common/content_restriction.h" | |
| 51 #include "content/public/common/renderer_preferences.h" | |
| 52 #include "content/public/browser/navigation_controller.h" | 50 #include "content/public/browser/navigation_controller.h" |
| 53 #include "content/public/browser/navigation_entry.h" | 51 #include "content/public/browser/navigation_entry.h" |
| 54 #include "content/public/browser/page_navigator.h" | 52 #include "content/public/browser/page_navigator.h" |
| 55 #include "content/public/browser/render_view_host.h" | 53 #include "content/public/browser/render_view_host.h" |
| 56 #include "content/public/browser/user_metrics.h" | 54 #include "content/public/browser/user_metrics.h" |
| 57 #include "content/public/browser/web_contents.h" | 55 #include "content/public/browser/web_contents.h" |
| 58 #include "content/public/browser/web_contents_view.h" | 56 #include "content/public/browser/web_contents_view.h" |
| 57 #include "content/public/common/content_restriction.h" |
| 58 #include "content/public/common/renderer_preferences.h" |
| 59 #include "content/public/common/url_constants.h" | 59 #include "content/public/common/url_constants.h" |
| 60 #include "net/base/escape.h" | 60 #include "net/base/escape.h" |
| 61 #include "webkit/glue/webkit_glue.h" | 61 #include "webkit/glue/webkit_glue.h" |
| 62 | 62 |
| 63 #if defined(OS_MACOSX) | 63 #if defined(OS_MACOSX) |
| 64 #include "ui/base/cocoa/find_pasteboard.h" | 64 #include "ui/base/cocoa/find_pasteboard.h" |
| 65 #endif | 65 #endif |
| 66 | 66 |
| 67 #if defined(OS_WIN) | 67 #if defined(OS_WIN) |
| 68 #include "base/win/metro.h" | 68 #include "base/win/metro.h" |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 if (!location_bar) | 334 if (!location_bar) |
| 335 return; | 335 return; |
| 336 | 336 |
| 337 WindowOpenDisposition open_disposition = | 337 WindowOpenDisposition open_disposition = |
| 338 location_bar->GetWindowOpenDisposition(); | 338 location_bar->GetWindowOpenDisposition(); |
| 339 if (browser->OpenInstant(open_disposition)) | 339 if (browser->OpenInstant(open_disposition)) |
| 340 return; | 340 return; |
| 341 | 341 |
| 342 GURL url(location_bar->GetInputString()); | 342 GURL url(location_bar->GetInputString()); |
| 343 | 343 |
| 344 browser::NavigateParams params(browser, url, | 344 chrome::NavigateParams params(browser, url, |
| 345 location_bar->GetPageTransition()); | 345 location_bar->GetPageTransition()); |
| 346 params.disposition = open_disposition; | 346 params.disposition = open_disposition; |
| 347 // Use ADD_INHERIT_OPENER so that all pages opened by the omnibox at least | 347 // Use ADD_INHERIT_OPENER so that all pages opened by the omnibox at least |
| 348 // inherit the opener. In some cases the tabstrip will determine the group | 348 // inherit the opener. In some cases the tabstrip will determine the group |
| 349 // should be inherited, in which case the group is inherited instead of the | 349 // should be inherited, in which case the group is inherited instead of the |
| 350 // opener. | 350 // opener. |
| 351 params.tabstrip_add_types = | 351 params.tabstrip_add_types = |
| 352 TabStripModel::ADD_FORCE_INDEX | TabStripModel::ADD_INHERIT_OPENER; | 352 TabStripModel::ADD_FORCE_INDEX | TabStripModel::ADD_INHERIT_OPENER; |
| 353 browser::Navigate(¶ms); | 353 chrome::Navigate(¶ms); |
| 354 | 354 |
| 355 DCHECK(browser->profile()->GetExtensionService()); | 355 DCHECK(browser->profile()->GetExtensionService()); |
| 356 if (browser->profile()->GetExtensionService()->IsInstalledApp(url)) { | 356 if (browser->profile()->GetExtensionService()->IsInstalledApp(url)) { |
| 357 AppLauncherHandler::RecordAppLaunchType( | 357 AppLauncherHandler::RecordAppLaunchType( |
| 358 extension_misc::APP_LAUNCH_OMNIBOX_LOCATION); | 358 extension_misc::APP_LAUNCH_OMNIBOX_LOCATION); |
| 359 } | 359 } |
| 360 } | 360 } |
| 361 | 361 |
| 362 void Stop(Browser* browser) { | 362 void Stop(Browser* browser) { |
| 363 content::RecordAction(UserMetricsAction("Stop")); | 363 content::RecordAction(UserMetricsAction("Stop")); |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 936 if (!tab_contents) | 936 if (!tab_contents) |
| 937 tab_contents = new TabContents(contents); | 937 tab_contents = new TabContents(contents); |
| 938 app_browser->tab_strip_model()->AppendTabContents(tab_contents, true); | 938 app_browser->tab_strip_model()->AppendTabContents(tab_contents, true); |
| 939 | 939 |
| 940 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 940 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
| 941 contents->GetRenderViewHost()->SyncRendererPrefs(); | 941 contents->GetRenderViewHost()->SyncRendererPrefs(); |
| 942 app_browser->window()->Show(); | 942 app_browser->window()->Show(); |
| 943 } | 943 } |
| 944 | 944 |
| 945 } // namespace chrome | 945 } // namespace chrome |
| OLD | NEW |