OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/chromeos/drive/file_task_executor.h" | 5 #include "chrome/browser/chromeos/drive/file_task_executor.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "chrome/browser/chromeos/drive/drive_integration_service.h" | 10 #include "chrome/browser/chromeos/drive/drive_integration_service.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 FileSystemInterface* GetFileSystem() override { | 36 FileSystemInterface* GetFileSystem() override { |
37 return util::GetFileSystemByProfile(profile_); | 37 return util::GetFileSystemByProfile(profile_); |
38 } | 38 } |
39 | 39 |
40 DriveServiceInterface* GetDriveService() override { | 40 DriveServiceInterface* GetDriveService() override { |
41 return util::GetDriveServiceByProfile(profile_); | 41 return util::GetDriveServiceByProfile(profile_); |
42 } | 42 } |
43 | 43 |
44 void OpenBrowserWindow(const GURL& open_link) override { | 44 void OpenBrowserWindow(const GURL& open_link) override { |
45 chrome::ScopedTabbedBrowserDisplayer displayer( | 45 chrome::ScopedTabbedBrowserDisplayer displayer(profile_, |
46 profile_, chrome::HOST_DESKTOP_TYPE_ASH); | 46 ui::HOST_DESKTOP_TYPE_ASH); |
47 chrome::AddSelectedTabWithURL(displayer.browser(), open_link, | 47 chrome::AddSelectedTabWithURL(displayer.browser(), open_link, |
48 ui::PAGE_TRANSITION_LINK); | 48 ui::PAGE_TRANSITION_LINK); |
49 // Since the ScopedTabbedBrowserDisplayer does not guarantee that the | 49 // Since the ScopedTabbedBrowserDisplayer does not guarantee that the |
50 // browser will be shown on the active desktop, we ensure the visibility. | 50 // browser will be shown on the active desktop, we ensure the visibility. |
51 multi_user_util::MoveWindowToCurrentDesktop( | 51 multi_user_util::MoveWindowToCurrentDesktop( |
52 displayer.browser()->window()->GetNativeWindow()); | 52 displayer.browser()->window()->GetNativeWindow()); |
53 } | 53 } |
54 | 54 |
55 private: | 55 private: |
56 Profile* const profile_; | 56 Profile* const profile_; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 void FileTaskExecutor::Done(bool success) { | 156 void FileTaskExecutor::Done(bool success) { |
157 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 157 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
158 if (!done_.is_null()) | 158 if (!done_.is_null()) |
159 done_.Run(success | 159 done_.Run(success |
160 ? extensions::api::file_manager_private::TASK_RESULT_OPENED | 160 ? extensions::api::file_manager_private::TASK_RESULT_OPENED |
161 : extensions::api::file_manager_private::TASK_RESULT_FAILED); | 161 : extensions::api::file_manager_private::TASK_RESULT_FAILED); |
162 delete this; | 162 delete this; |
163 } | 163 } |
164 | 164 |
165 } // namespace drive | 165 } // namespace drive |
OLD | NEW |