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 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 NavigationEntry* entry = controller.GetActiveEntry(); | 954 NavigationEntry* entry = controller.GetActiveEntry(); |
955 if (!entry) | 955 if (!entry) |
956 return; | 956 return; |
957 if (entry->GetIsOverridingUserAgent()) { | 957 if (entry->GetIsOverridingUserAgent()) { |
958 entry->SetIsOverridingUserAgent(false); | 958 entry->SetIsOverridingUserAgent(false); |
959 } else { | 959 } else { |
960 entry->SetIsOverridingUserAgent(true); | 960 entry->SetIsOverridingUserAgent(true); |
961 current_tab->SetUserAgentOverride( | 961 current_tab->SetUserAgentOverride( |
962 webkit_glue::BuildUserAgentFromOSAndProduct( | 962 webkit_glue::BuildUserAgentFromOSAndProduct( |
963 kOsOverrideForTabletSite, | 963 kOsOverrideForTabletSite, |
964 content::GetContentClient()->GetProduct())); | 964 ChromeContentClient::GetProductImpl())); |
965 } | 965 } |
966 controller.ReloadOriginalRequestURL(true); | 966 controller.ReloadOriginalRequestURL(true); |
967 } | 967 } |
968 | 968 |
969 void ToggleFullscreenMode(Browser* browser) { | 969 void ToggleFullscreenMode(Browser* browser) { |
970 browser->fullscreen_controller()->ToggleFullscreenMode(); | 970 browser->fullscreen_controller()->ToggleFullscreenMode(); |
971 } | 971 } |
972 | 972 |
973 void ClearCache(Browser* browser) { | 973 void ClearCache(Browser* browser) { |
974 BrowsingDataRemover* remover = | 974 BrowsingDataRemover* remover = |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1097 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(), | 1097 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(), |
1098 browser->host_desktop_type())); | 1098 browser->host_desktop_type())); |
1099 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1099 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
1100 | 1100 |
1101 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1101 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
1102 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1102 contents->GetRenderViewHost()->SyncRendererPrefs(); |
1103 app_browser->window()->Show(); | 1103 app_browser->window()->Show(); |
1104 } | 1104 } |
1105 | 1105 |
1106 } // namespace chrome | 1106 } // namespace chrome |
OLD | NEW |