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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 #include "content/public/browser/notification_service.h" | 70 #include "content/public/browser/notification_service.h" |
71 #include "content/public/browser/page_navigator.h" | 71 #include "content/public/browser/page_navigator.h" |
72 #include "content/public/browser/render_view_host.h" | 72 #include "content/public/browser/render_view_host.h" |
73 #include "content/public/browser/render_widget_host_view.h" | 73 #include "content/public/browser/render_widget_host_view.h" |
74 #include "content/public/browser/user_metrics.h" | 74 #include "content/public/browser/user_metrics.h" |
75 #include "content/public/browser/web_contents.h" | 75 #include "content/public/browser/web_contents.h" |
76 #include "content/public/browser/web_contents_view.h" | 76 #include "content/public/browser/web_contents_view.h" |
77 #include "content/public/common/renderer_preferences.h" | 77 #include "content/public/common/renderer_preferences.h" |
78 #include "content/public/common/url_constants.h" | 78 #include "content/public/common/url_constants.h" |
79 #include "content/public/common/url_utils.h" | 79 #include "content/public/common/url_utils.h" |
| 80 #include "content/public/common/user_agent.h" |
80 #include "extensions/browser/extension_system.h" | 81 #include "extensions/browser/extension_system.h" |
81 #include "net/base/escape.h" | 82 #include "net/base/escape.h" |
82 #include "ui/events/keycodes/keyboard_codes.h" | 83 #include "ui/events/keycodes/keyboard_codes.h" |
83 #include "webkit/common/user_agent/user_agent_util.h" | |
84 | 84 |
85 #if defined(OS_WIN) | 85 #if defined(OS_WIN) |
86 #include "chrome/browser/ui/metro_pin_tab_helper_win.h" | 86 #include "chrome/browser/ui/metro_pin_tab_helper_win.h" |
87 #include "win8/util/win8_util.h" | 87 #include "win8/util/win8_util.h" |
88 #endif | 88 #endif |
89 | 89 |
90 #if defined(ENABLE_PRINTING) | 90 #if defined(ENABLE_PRINTING) |
91 #if defined(ENABLE_FULL_PRINTING) | 91 #if defined(ENABLE_FULL_PRINTING) |
92 #include "chrome/browser/printing/print_preview_dialog_controller.h" | 92 #include "chrome/browser/printing/print_preview_dialog_controller.h" |
93 #include "chrome/browser/printing/print_view_manager.h" | 93 #include "chrome/browser/printing/print_view_manager.h" |
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1091 if (!entry) | 1091 if (!entry) |
1092 return; | 1092 return; |
1093 if (entry->GetIsOverridingUserAgent()) { | 1093 if (entry->GetIsOverridingUserAgent()) { |
1094 entry->SetIsOverridingUserAgent(false); | 1094 entry->SetIsOverridingUserAgent(false); |
1095 } else { | 1095 } else { |
1096 entry->SetIsOverridingUserAgent(true); | 1096 entry->SetIsOverridingUserAgent(true); |
1097 chrome::VersionInfo version_info; | 1097 chrome::VersionInfo version_info; |
1098 std::string product; | 1098 std::string product; |
1099 if (version_info.is_valid()) | 1099 if (version_info.is_valid()) |
1100 product = version_info.ProductNameAndVersionForUserAgent(); | 1100 product = version_info.ProductNameAndVersionForUserAgent(); |
1101 current_tab->SetUserAgentOverride( | 1101 current_tab->SetUserAgentOverride(content::BuildUserAgentFromOSAndProduct( |
1102 webkit_glue::BuildUserAgentFromOSAndProduct( | 1102 kOsOverrideForTabletSite, product)); |
1103 kOsOverrideForTabletSite, product)); | |
1104 } | 1103 } |
1105 controller.ReloadOriginalRequestURL(true); | 1104 controller.ReloadOriginalRequestURL(true); |
1106 } | 1105 } |
1107 | 1106 |
1108 void ToggleFullscreenMode(Browser* browser) { | 1107 void ToggleFullscreenMode(Browser* browser) { |
1109 browser->fullscreen_controller()->ToggleFullscreenMode(); | 1108 browser->fullscreen_controller()->ToggleFullscreenMode(); |
1110 } | 1109 } |
1111 | 1110 |
1112 void ClearCache(Browser* browser) { | 1111 void ClearCache(Browser* browser) { |
1113 BrowsingDataRemover* remover = | 1112 BrowsingDataRemover* remover = |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1244 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(), | 1243 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(), |
1245 browser->host_desktop_type())); | 1244 browser->host_desktop_type())); |
1246 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1245 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
1247 | 1246 |
1248 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1247 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
1249 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1248 contents->GetRenderViewHost()->SyncRendererPrefs(); |
1250 app_browser->window()->Show(); | 1249 app_browser->window()->Show(); |
1251 } | 1250 } |
1252 | 1251 |
1253 } // namespace chrome | 1252 } // namespace chrome |
OLD | NEW |