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