| 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/file_manager/open_with_browser.h" | 5 #include "chrome/browser/chromeos/file_manager/open_with_browser.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 101 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 102 | 102 |
| 103 // Check the validity of the pointer so that the closure from | 103 // Check the validity of the pointer so that the closure from |
| 104 // base::Bind(&OpenNewTab, profile) can be passed between threads. | 104 // base::Bind(&OpenNewTab, profile) can be passed between threads. |
| 105 if (!g_browser_process->profile_manager()->IsValidProfile(profile)) | 105 if (!g_browser_process->profile_manager()->IsValidProfile(profile)) |
| 106 return; | 106 return; |
| 107 | 107 |
| 108 chrome::ScopedTabbedBrowserDisplayer displayer( | 108 chrome::ScopedTabbedBrowserDisplayer displayer( |
| 109 profile, chrome::HOST_DESKTOP_TYPE_ASH); | 109 profile, chrome::HOST_DESKTOP_TYPE_ASH); |
| 110 chrome::AddSelectedTabWithURL(displayer.browser(), url, | 110 chrome::AddSelectedTabWithURL(displayer.browser(), url, |
| 111 content::PAGE_TRANSITION_LINK); | 111 ui::PAGE_TRANSITION_LINK); |
| 112 | 112 |
| 113 // Since the ScopedTabbedBrowserDisplayer does not guarantee that the | 113 // Since the ScopedTabbedBrowserDisplayer does not guarantee that the |
| 114 // browser will be shown on the active desktop, we ensure the visibility. | 114 // browser will be shown on the active desktop, we ensure the visibility. |
| 115 multi_user_util::MoveWindowToCurrentDesktop( | 115 multi_user_util::MoveWindowToCurrentDesktop( |
| 116 displayer.browser()->window()->GetNativeWindow()); | 116 displayer.browser()->window()->GetNativeWindow()); |
| 117 } | 117 } |
| 118 | 118 |
| 119 // Reads the alternate URL from a GDoc file. When it fails, returns a file URL | 119 // Reads the alternate URL from a GDoc file. When it fails, returns a file URL |
| 120 // for |file_path| as fallback. | 120 // for |file_path| as fallback. |
| 121 // Note that an alternate url is a URL to open a hosted document. | 121 // Note that an alternate url is a URL to open a hosted document. |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 base::FilePath::FromUTF8Unsafe("dummy").AddExtension(file_extension); | 179 base::FilePath::FromUTF8Unsafe("dummy").AddExtension(file_extension); |
| 180 if (file_path.MatchesExtension(kPdfExtension)) | 180 if (file_path.MatchesExtension(kPdfExtension)) |
| 181 return IsPdfPluginEnabled(profile); | 181 return IsPdfPluginEnabled(profile); |
| 182 if (file_path.MatchesExtension(kSwfExtension)) | 182 if (file_path.MatchesExtension(kSwfExtension)) |
| 183 return IsFlashPluginEnabled(profile); | 183 return IsFlashPluginEnabled(profile); |
| 184 return false; | 184 return false; |
| 185 } | 185 } |
| 186 | 186 |
| 187 } // namespace util | 187 } // namespace util |
| 188 } // namespace file_manager | 188 } // namespace file_manager |
| OLD | NEW |