| 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/chromeos/extensions/file_manager/private_api_misc.h" | 5 #include "chrome/browser/chromeos/extensions/file_manager/private_api_misc.h" |
| 6 | 6 |
| 7 #include "ash/frame/frame_util.h" | 7 #include "ash/frame/frame_util.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/chromeos/drive/file_system_util.h" | 13 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| 14 #include "chrome/browser/chromeos/extensions/file_manager/event_router.h" | |
| 15 #include "chrome/browser/chromeos/extensions/file_manager/file_browser_private_a
pi.h" | 14 #include "chrome/browser/chromeos/extensions/file_manager/file_browser_private_a
pi.h" |
| 16 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" | 15 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" |
| 17 #include "chrome/browser/chromeos/file_manager/app_installer.h" | 16 #include "chrome/browser/chromeos/file_manager/app_installer.h" |
| 18 #include "chrome/browser/chromeos/file_manager/zip_file_creator.h" | 17 #include "chrome/browser/chromeos/file_manager/zip_file_creator.h" |
| 19 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 18 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 20 #include "chrome/browser/chromeos/settings/cros_settings.h" | 19 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 21 #include "chrome/browser/devtools/devtools_window.h" | 20 #include "chrome/browser/devtools/devtools_window.h" |
| 22 #include "chrome/browser/drive/event_logger.h" | 21 #include "chrome/browser/drive/event_logger.h" |
| 23 #include "chrome/browser/extensions/devtools_util.h" | 22 #include "chrome/browser/extensions/devtools_util.h" |
| 24 #include "chrome/browser/lifetime/application_lifetime.h" | 23 #include "chrome/browser/lifetime/application_lifetime.h" |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 return false; | 410 return false; |
| 412 } | 411 } |
| 413 | 412 |
| 414 // Look for the current app window. | 413 // Look for the current app window. |
| 415 AppWindow* const app_window = GetCurrentAppWindow(this); | 414 AppWindow* const app_window = GetCurrentAppWindow(this); |
| 416 if (!app_window) { | 415 if (!app_window) { |
| 417 SetError("Target window is not found."); | 416 SetError("Target window is not found."); |
| 418 return false; | 417 return false; |
| 419 } | 418 } |
| 420 | 419 |
| 421 // Observe owner changes of windows. | |
| 422 file_manager::EventRouter* const event_router = | |
| 423 file_manager::FileBrowserPrivateAPI::Get(GetProfile())->event_router(); | |
| 424 event_router->RegisterMultiUserWindowManagerObserver(); | |
| 425 | |
| 426 // Move the window to the user's desktop. | 420 // Move the window to the user's desktop. |
| 427 window_manager->ShowWindowForUser(app_window->GetNativeWindow(), | 421 window_manager->ShowWindowForUser(app_window->GetNativeWindow(), |
| 428 params->profile_id); | 422 params->profile_id); |
| 429 | 423 |
| 430 // Check the result. | 424 // Check the result. |
| 431 if (!window_manager->IsWindowOnDesktopOfUser(app_window->GetNativeWindow(), | 425 if (!window_manager->IsWindowOnDesktopOfUser(app_window->GetNativeWindow(), |
| 432 params->profile_id)) { | 426 params->profile_id)) { |
| 433 SetError("The window cannot visit the desktop."); | 427 SetError("The window cannot visit the desktop."); |
| 434 return false; | 428 return false; |
| 435 } | 429 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 NOTREACHED(); | 463 NOTREACHED(); |
| 470 SetError( | 464 SetError( |
| 471 base::StringPrintf("Unexpected inspection type(%d) is specified.", | 465 base::StringPrintf("Unexpected inspection type(%d) is specified.", |
| 472 static_cast<int>(params->type))); | 466 static_cast<int>(params->type))); |
| 473 return false; | 467 return false; |
| 474 } | 468 } |
| 475 return true; | 469 return true; |
| 476 } | 470 } |
| 477 | 471 |
| 478 } // namespace extensions | 472 } // namespace extensions |
| OLD | NEW |