Chromium Code Reviews| 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_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 108 #endif // defined(ENABLE_PRINTING) | 108 #endif // defined(ENABLE_PRINTING) |
| 109 | 109 |
| 110 #if defined(ENABLE_RLZ) | 110 #if defined(ENABLE_RLZ) |
| 111 #include "components/rlz/rlz_tracker.h" // nogncheck | 111 #include "components/rlz/rlz_tracker.h" // nogncheck |
| 112 #endif | 112 #endif |
| 113 | 113 |
| 114 #if defined(ENABLE_MEDIA_ROUTER) | 114 #if defined(ENABLE_MEDIA_ROUTER) |
| 115 #include "chrome/browser/media/router/media_router_dialog_controller.h" // nogn check | 115 #include "chrome/browser/media/router/media_router_dialog_controller.h" // nogn check |
| 116 #endif | 116 #endif |
| 117 | 117 |
| 118 #if defined(USE_ASH) | |
| 119 #include "chrome/browser/ui/ash/ash_util.h" | |
| 120 #include "content/public/common/service_manager_connection.h" | |
| 121 #include "mash/public/interfaces/launchable.mojom.h" | |
| 122 #include "services/service_manager/public/cpp/connector.h" | |
| 123 #endif | |
| 124 | |
| 118 namespace { | 125 namespace { |
| 119 const char kOsOverrideForTabletSite[] = "Linux; Android 4.0.3"; | 126 const char kOsOverrideForTabletSite[] = "Linux; Android 4.0.3"; |
| 120 } | 127 } |
| 121 | 128 |
| 122 using base::UserMetricsAction; | 129 using base::UserMetricsAction; |
| 123 using bookmarks::BookmarkModel; | 130 using bookmarks::BookmarkModel; |
| 124 using content::NavigationController; | 131 using content::NavigationController; |
| 125 using content::NavigationEntry; | 132 using content::NavigationEntry; |
| 126 using content::OpenURLParams; | 133 using content::OpenURLParams; |
| 127 using content::Referrer; | 134 using content::Referrer; |
| (...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1053 #if defined(ENABLE_TASK_MANAGER) | 1060 #if defined(ENABLE_TASK_MANAGER) |
| 1054 return true; | 1061 return true; |
| 1055 #else | 1062 #else |
| 1056 return false; | 1063 return false; |
| 1057 #endif | 1064 #endif |
| 1058 } | 1065 } |
| 1059 | 1066 |
| 1060 void OpenTaskManager(Browser* browser) { | 1067 void OpenTaskManager(Browser* browser) { |
| 1061 #if defined(ENABLE_TASK_MANAGER) | 1068 #if defined(ENABLE_TASK_MANAGER) |
| 1062 content::RecordAction(UserMetricsAction("TaskManager")); | 1069 content::RecordAction(UserMetricsAction("TaskManager")); |
| 1063 chrome::ShowTaskManager(browser); | 1070 |
| 1071 #if defined(USE_ASH) | |
| 1072 if (chrome::IsRunningInMash()) { | |
|
sky
2016/10/21 23:26:00
The mash task viewer doesn't convey everything the
Elliot Glaysher
2016/10/25 23:30:50
Moved back to chrome's task viewer for now.
| |
| 1073 // In mash, the task viewer is a separate application because there are | |
| 1074 // more applications than chrome. | |
| 1075 service_manager::Connector* connector = | |
| 1076 content::ServiceManagerConnection::GetForProcess()->GetConnector(); | |
| 1077 mash::mojom::LaunchablePtr launchable; | |
| 1078 connector->ConnectToInterface("service:task_viewer", &launchable); | |
| 1079 launchable->Launch(mash::mojom::kWindow, | |
| 1080 mash::mojom::LaunchMode::DEFAULT); | |
| 1081 } | |
| 1082 else | |
| 1083 #endif | |
| 1084 { | |
| 1085 chrome::ShowTaskManager(browser); | |
| 1086 } | |
| 1064 #else | 1087 #else |
| 1065 NOTREACHED(); | 1088 NOTREACHED(); |
| 1066 #endif | 1089 #endif |
| 1067 } | 1090 } |
| 1068 | 1091 |
| 1069 void OpenFeedbackDialog(Browser* browser) { | 1092 void OpenFeedbackDialog(Browser* browser) { |
| 1070 content::RecordAction(UserMetricsAction("Feedback")); | 1093 content::RecordAction(UserMetricsAction("Feedback")); |
| 1071 chrome::ShowFeedbackPage(browser, std::string(), std::string()); | 1094 chrome::ShowFeedbackPage(browser, std::string(), std::string()); |
| 1072 } | 1095 } |
| 1073 | 1096 |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1297 app_name, true /* trusted_source */, gfx::Rect(), browser->profile())); | 1320 app_name, true /* trusted_source */, gfx::Rect(), browser->profile())); |
| 1298 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1321 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
| 1299 | 1322 |
| 1300 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1323 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
| 1301 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1324 contents->GetRenderViewHost()->SyncRendererPrefs(); |
| 1302 app_browser->window()->Show(); | 1325 app_browser->window()->Show(); |
| 1303 } | 1326 } |
| 1304 #endif // defined(ENABLE_EXTENSIONS) | 1327 #endif // defined(ENABLE_EXTENSIONS) |
| 1305 | 1328 |
| 1306 } // namespace chrome | 1329 } // namespace chrome |
| OLD | NEW |