Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1200)

Side by Side Diff: chrome/browser/ui/browser_commands.cc

Issue 2434463004: mash: Move directly linked NewWindowDelegate to mojom::NewWindowClient. (Closed)
Patch Set: Actually rename the browser test. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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()) {
1073 service_manager::Connector* connector =
James Cook 2016/10/21 22:22:31 nit: Maybe comment pointing out that under mash th
Elliot Glaysher 2016/10/21 22:45:56 Done.
1074 content::ServiceManagerConnection::GetForProcess()->GetConnector();
1075 mash::mojom::LaunchablePtr launchable;
1076 connector->ConnectToInterface("service:task_viewer", &launchable);
1077 launchable->Launch(mash::mojom::kWindow,
1078 mash::mojom::LaunchMode::DEFAULT);
1079 }
1080 else
1081 #endif
1082 {
1083 chrome::ShowTaskManager(browser);
1084 }
1064 #else 1085 #else
1065 NOTREACHED(); 1086 NOTREACHED();
1066 #endif 1087 #endif
1067 } 1088 }
1068 1089
1069 void OpenFeedbackDialog(Browser* browser) { 1090 void OpenFeedbackDialog(Browser* browser) {
1070 content::RecordAction(UserMetricsAction("Feedback")); 1091 content::RecordAction(UserMetricsAction("Feedback"));
1071 chrome::ShowFeedbackPage(browser, std::string(), std::string()); 1092 chrome::ShowFeedbackPage(browser, std::string(), std::string());
1072 } 1093 }
1073 1094
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
1297 app_name, true /* trusted_source */, gfx::Rect(), browser->profile())); 1318 app_name, true /* trusted_source */, gfx::Rect(), browser->profile()));
1298 app_browser->tab_strip_model()->AppendWebContents(contents, true); 1319 app_browser->tab_strip_model()->AppendWebContents(contents, true);
1299 1320
1300 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; 1321 contents->GetMutableRendererPrefs()->can_accept_load_drops = false;
1301 contents->GetRenderViewHost()->SyncRendererPrefs(); 1322 contents->GetRenderViewHost()->SyncRendererPrefs();
1302 app_browser->window()->Show(); 1323 app_browser->window()->Show();
1303 } 1324 }
1304 #endif // defined(ENABLE_EXTENSIONS) 1325 #endif // defined(ENABLE_EXTENSIONS)
1305 1326
1306 } // namespace chrome 1327 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698