| 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/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 #include "net/base/escape.h" | 72 #include "net/base/escape.h" |
| 73 #include "webkit/glue/glue_serialize.h" | 73 #include "webkit/glue/glue_serialize.h" |
| 74 #include "webkit/glue/web_intent_data.h" | 74 #include "webkit/glue/web_intent_data.h" |
| 75 #include "webkit/user_agent/user_agent_util.h" | 75 #include "webkit/user_agent/user_agent_util.h" |
| 76 | 76 |
| 77 #if defined(OS_MACOSX) | 77 #if defined(OS_MACOSX) |
| 78 #include "ui/base/cocoa/find_pasteboard.h" | 78 #include "ui/base/cocoa/find_pasteboard.h" |
| 79 #endif | 79 #endif |
| 80 | 80 |
| 81 #if defined(OS_WIN) | 81 #if defined(OS_WIN) |
| 82 #include "base/win/metro.h" | |
| 83 #include "chrome/browser/ui/metro_pin_tab_helper_win.h" | 82 #include "chrome/browser/ui/metro_pin_tab_helper_win.h" |
| 83 #include "win8/util/win8_util.h" |
| 84 #endif | 84 #endif |
| 85 | 85 |
| 86 namespace { | 86 namespace { |
| 87 const char kOsOverrideForTabletSite[] = "Linux; Android 4.0.3"; | 87 const char kOsOverrideForTabletSite[] = "Linux; Android 4.0.3"; |
| 88 } | 88 } |
| 89 | 89 |
| 90 using content::NavigationController; | 90 using content::NavigationController; |
| 91 using content::NavigationEntry; | 91 using content::NavigationEntry; |
| 92 using content::OpenURLParams; | 92 using content::OpenURLParams; |
| 93 using content::Referrer; | 93 using content::Referrer; |
| (...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 if (action == DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE) | 859 if (action == DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE) |
| 860 content::RecordAction(UserMetricsAction("DevTools_ToggleConsole")); | 860 content::RecordAction(UserMetricsAction("DevTools_ToggleConsole")); |
| 861 else | 861 else |
| 862 content::RecordAction(UserMetricsAction("DevTools_ToggleWindow")); | 862 content::RecordAction(UserMetricsAction("DevTools_ToggleWindow")); |
| 863 DevToolsWindow::ToggleDevToolsWindow(browser, action); | 863 DevToolsWindow::ToggleDevToolsWindow(browser, action); |
| 864 } | 864 } |
| 865 | 865 |
| 866 bool CanOpenTaskManager() { | 866 bool CanOpenTaskManager() { |
| 867 #if defined(OS_WIN) | 867 #if defined(OS_WIN) |
| 868 // In metro we can't display the task manager, as it is a native window. | 868 // In metro we can't display the task manager, as it is a native window. |
| 869 return !base::win::IsMetroProcess(); | 869 return !win8::IsSingleWindowMetroMode(); |
| 870 #else | 870 #else |
| 871 return true; | 871 return true; |
| 872 #endif | 872 #endif |
| 873 } | 873 } |
| 874 | 874 |
| 875 void OpenTaskManager(Browser* browser, bool highlight_background_resources) { | 875 void OpenTaskManager(Browser* browser, bool highlight_background_resources) { |
| 876 content::RecordAction(UserMetricsAction("TaskManager")); | 876 content::RecordAction(UserMetricsAction("TaskManager")); |
| 877 if (highlight_background_resources) | 877 if (highlight_background_resources) |
| 878 browser->window()->ShowBackgroundPages(); | 878 browser->window()->ShowBackgroundPages(); |
| 879 else | 879 else |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1072 Browser::CreateParams::CreateForApp( | 1072 Browser::CreateParams::CreateForApp( |
| 1073 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile())); | 1073 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile())); |
| 1074 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1074 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
| 1075 | 1075 |
| 1076 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1076 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
| 1077 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1077 contents->GetRenderViewHost()->SyncRendererPrefs(); |
| 1078 app_browser->window()->Show(); | 1078 app_browser->window()->Show(); |
| 1079 } | 1079 } |
| 1080 | 1080 |
| 1081 } // namespace chrome | 1081 } // namespace chrome |
| OLD | NEW |