| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 48 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
| 49 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 49 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
| 50 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" | 50 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" |
| 51 #include "chrome/browser/ui/omnibox/location_bar.h" | 51 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 52 #include "chrome/browser/ui/status_bubble.h" | 52 #include "chrome/browser/ui/status_bubble.h" |
| 53 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 53 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 54 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h" | 54 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h" |
| 55 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" | 55 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" |
| 56 #include "chrome/browser/upgrade_detector.h" | 56 #include "chrome/browser/upgrade_detector.h" |
| 57 #include "chrome/browser/web_applications/web_app.h" | 57 #include "chrome/browser/web_applications/web_app.h" |
| 58 #include "chrome/common/chrome_content_client.h" |
| 58 #include "chrome/common/chrome_notification_types.h" | 59 #include "chrome/common/chrome_notification_types.h" |
| 59 #include "chrome/common/chrome_switches.h" | 60 #include "chrome/common/chrome_switches.h" |
| 60 #include "chrome/common/pref_names.h" | 61 #include "chrome/common/pref_names.h" |
| 61 #include "content/public/browser/devtools_agent_host.h" | 62 #include "content/public/browser/devtools_agent_host.h" |
| 62 #include "content/public/browser/navigation_controller.h" | 63 #include "content/public/browser/navigation_controller.h" |
| 63 #include "content/public/browser/navigation_entry.h" | 64 #include "content/public/browser/navigation_entry.h" |
| 64 #include "content/public/browser/notification_service.h" | 65 #include "content/public/browser/notification_service.h" |
| 65 #include "content/public/browser/page_navigator.h" | 66 #include "content/public/browser/page_navigator.h" |
| 66 #include "content/public/browser/render_view_host.h" | 67 #include "content/public/browser/render_view_host.h" |
| 67 #include "content/public/browser/user_metrics.h" | 68 #include "content/public/browser/user_metrics.h" |
| 68 #include "content/public/browser/web_contents.h" | 69 #include "content/public/browser/web_contents.h" |
| 69 #include "content/public/browser/web_contents_view.h" | 70 #include "content/public/browser/web_contents_view.h" |
| 70 #include "content/public/common/content_client.h" | |
| 71 #include "content/public/common/content_restriction.h" | 71 #include "content/public/common/content_restriction.h" |
| 72 #include "content/public/common/renderer_preferences.h" | 72 #include "content/public/common/renderer_preferences.h" |
| 73 #include "content/public/common/url_constants.h" | 73 #include "content/public/common/url_constants.h" |
| 74 #include "net/base/escape.h" | 74 #include "net/base/escape.h" |
| 75 #include "webkit/glue/glue_serialize.h" | 75 #include "webkit/glue/glue_serialize.h" |
| 76 #include "webkit/user_agent/user_agent_util.h" | 76 #include "webkit/user_agent/user_agent_util.h" |
| 77 | 77 |
| 78 #if defined(OS_MACOSX) | 78 #if defined(OS_MACOSX) |
| 79 #include "ui/base/cocoa/find_pasteboard.h" | 79 #include "ui/base/cocoa/find_pasteboard.h" |
| 80 #endif | 80 #endif |
| (...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 953 NavigationEntry* entry = controller.GetActiveEntry(); | 953 NavigationEntry* entry = controller.GetActiveEntry(); |
| 954 if (!entry) | 954 if (!entry) |
| 955 return; | 955 return; |
| 956 if (entry->GetIsOverridingUserAgent()) { | 956 if (entry->GetIsOverridingUserAgent()) { |
| 957 entry->SetIsOverridingUserAgent(false); | 957 entry->SetIsOverridingUserAgent(false); |
| 958 } else { | 958 } else { |
| 959 entry->SetIsOverridingUserAgent(true); | 959 entry->SetIsOverridingUserAgent(true); |
| 960 current_tab->SetUserAgentOverride( | 960 current_tab->SetUserAgentOverride( |
| 961 webkit_glue::BuildUserAgentFromOSAndProduct( | 961 webkit_glue::BuildUserAgentFromOSAndProduct( |
| 962 kOsOverrideForTabletSite, | 962 kOsOverrideForTabletSite, |
| 963 content::GetContentClient()->GetProduct())); | 963 ChromeContentClient::GetProductImpl())); |
| 964 } | 964 } |
| 965 controller.ReloadOriginalRequestURL(true); | 965 controller.ReloadOriginalRequestURL(true); |
| 966 } | 966 } |
| 967 | 967 |
| 968 void ToggleFullscreenMode(Browser* browser) { | 968 void ToggleFullscreenMode(Browser* browser) { |
| 969 browser->fullscreen_controller()->ToggleFullscreenMode(); | 969 browser->fullscreen_controller()->ToggleFullscreenMode(); |
| 970 } | 970 } |
| 971 | 971 |
| 972 void ClearCache(Browser* browser) { | 972 void ClearCache(Browser* browser) { |
| 973 BrowsingDataRemover* remover = | 973 BrowsingDataRemover* remover = |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1096 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(), | 1096 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(), |
| 1097 browser->host_desktop_type())); | 1097 browser->host_desktop_type())); |
| 1098 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1098 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
| 1099 | 1099 |
| 1100 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1100 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
| 1101 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1101 contents->GetRenderViewHost()->SyncRendererPrefs(); |
| 1102 app_browser->window()->Show(); | 1102 app_browser->window()->Show(); |
| 1103 } | 1103 } |
| 1104 | 1104 |
| 1105 } // namespace chrome | 1105 } // namespace chrome |
| OLD | NEW |