| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ash/chrome_new_window_client.h" | 5 #include "chrome/browser/ui/ash/chrome_new_window_client.h" |
| 6 | 6 |
| 7 #include "ash/content/keyboard_overlay/keyboard_overlay_view.h" | 7 #include "ash/content/keyboard_overlay/keyboard_overlay_view.h" |
| 8 #include "ash/public/interfaces/constants.mojom.h" |
| 8 #include "base/macros.h" | 9 #include "base/macros.h" |
| 9 #include "chrome/browser/chromeos/file_manager/app_id.h" | 10 #include "chrome/browser/chromeos/file_manager/app_id.h" |
| 10 #include "chrome/browser/extensions/api/terminal/terminal_extension_helper.h" | 11 #include "chrome/browser/extensions/api/terminal/terminal_extension_helper.h" |
| 11 #include "chrome/browser/extensions/extension_service.h" | 12 #include "chrome/browser/extensions/extension_service.h" |
| 12 #include "chrome/browser/extensions/extension_util.h" | 13 #include "chrome/browser/extensions/extension_util.h" |
| 13 #include "chrome/browser/profiles/profile_manager.h" | 14 #include "chrome/browser/profiles/profile_manager.h" |
| 14 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 15 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
| 15 #include "chrome/browser/ui/ash/ash_util.h" | |
| 16 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" | 16 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
| 17 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
| 18 #include "chrome/browser/ui/browser_commands.h" | 18 #include "chrome/browser/ui/browser_commands.h" |
| 19 #include "chrome/browser/ui/browser_finder.h" | 19 #include "chrome/browser/ui/browser_finder.h" |
| 20 #include "chrome/browser/ui/browser_list.h" | 20 #include "chrome/browser/ui/browser_list.h" |
| 21 #include "chrome/browser/ui/browser_window.h" | 21 #include "chrome/browser/ui/browser_window.h" |
| 22 #include "chrome/browser/ui/chrome_pages.h" | 22 #include "chrome/browser/ui/chrome_pages.h" |
| 23 #include "chrome/browser/ui/extensions/app_launch_params.h" | 23 #include "chrome/browser/ui/extensions/app_launch_params.h" |
| 24 #include "chrome/browser/ui/extensions/application_launch.h" | 24 #include "chrome/browser/ui/extensions/application_launch.h" |
| 25 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 25 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 54 aura::client::GetActivationClient(window->GetRootWindow()); | 54 aura::client::GetActivationClient(window->GetRootWindow()); |
| 55 if (client->GetActiveWindow() == window) | 55 if (client->GetActiveWindow() == window) |
| 56 return browser; | 56 return browser; |
| 57 } | 57 } |
| 58 return nullptr; | 58 return nullptr; |
| 59 } | 59 } |
| 60 | 60 |
| 61 ChromeNewWindowClient::ChromeNewWindowClient() : binding_(this) { | 61 ChromeNewWindowClient::ChromeNewWindowClient() : binding_(this) { |
| 62 service_manager::Connector* connector = | 62 service_manager::Connector* connector = |
| 63 content::ServiceManagerConnection::GetForProcess()->GetConnector(); | 63 content::ServiceManagerConnection::GetForProcess()->GetConnector(); |
| 64 connector->BindInterface(ash_util::GetAshServiceName(), | 64 connector->BindInterface(ash::mojom::kServiceName, &new_window_controller_); |
| 65 &new_window_controller_); | |
| 66 | 65 |
| 67 // Register this object as the client interface implementation. | 66 // Register this object as the client interface implementation. |
| 68 ash::mojom::NewWindowClientAssociatedPtrInfo ptr_info; | 67 ash::mojom::NewWindowClientAssociatedPtrInfo ptr_info; |
| 69 binding_.Bind(&ptr_info); | 68 binding_.Bind(&ptr_info); |
| 70 new_window_controller_->SetClient(std::move(ptr_info)); | 69 new_window_controller_->SetClient(std::move(ptr_info)); |
| 71 } | 70 } |
| 72 | 71 |
| 73 ChromeNewWindowClient::~ChromeNewWindowClient() {} | 72 ChromeNewWindowClient::~ChromeNewWindowClient() {} |
| 74 | 73 |
| 75 // TabRestoreHelper is used to restore a tab. In particular when the user | 74 // TabRestoreHelper is used to restore a tab. In particular when the user |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 GURL(url)); | 213 GURL(url)); |
| 215 } | 214 } |
| 216 | 215 |
| 217 void ChromeNewWindowClient::ShowTaskManager() { | 216 void ChromeNewWindowClient::ShowTaskManager() { |
| 218 chrome::OpenTaskManager(nullptr); | 217 chrome::OpenTaskManager(nullptr); |
| 219 } | 218 } |
| 220 | 219 |
| 221 void ChromeNewWindowClient::OpenFeedbackPage() { | 220 void ChromeNewWindowClient::OpenFeedbackPage() { |
| 222 chrome::OpenFeedbackDialog(GetActiveBrowser()); | 221 chrome::OpenFeedbackDialog(GetActiveBrowser()); |
| 223 } | 222 } |
| OLD | NEW |