| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 } | 104 } |
| 105 | 105 |
| 106 void OpenNewTab(Profile* profile, const GURL& url) { | 106 void OpenNewTab(Profile* profile, const GURL& url) { |
| 107 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 107 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 108 | 108 |
| 109 // Check the validity of the pointer so that the closure from | 109 // Check the validity of the pointer so that the closure from |
| 110 // base::Bind(&OpenNewTab, profile) can be passed between threads. | 110 // base::Bind(&OpenNewTab, profile) can be passed between threads. |
| 111 if (!g_browser_process->profile_manager()->IsValidProfile(profile)) | 111 if (!g_browser_process->profile_manager()->IsValidProfile(profile)) |
| 112 return; | 112 return; |
| 113 | 113 |
| 114 chrome::ScopedTabbedBrowserDisplayer displayer( | 114 chrome::ScopedTabbedBrowserDisplayer displayer(profile, |
| 115 profile, chrome::HOST_DESKTOP_TYPE_ASH); | 115 ui::HOST_DESKTOP_TYPE_ASH); |
| 116 chrome::AddSelectedTabWithURL(displayer.browser(), url, | 116 chrome::AddSelectedTabWithURL(displayer.browser(), url, |
| 117 ui::PAGE_TRANSITION_LINK); | 117 ui::PAGE_TRANSITION_LINK); |
| 118 | 118 |
| 119 // Since the ScopedTabbedBrowserDisplayer does not guarantee that the | 119 // Since the ScopedTabbedBrowserDisplayer does not guarantee that the |
| 120 // browser will be shown on the active desktop, we ensure the visibility. | 120 // browser will be shown on the active desktop, we ensure the visibility. |
| 121 multi_user_util::MoveWindowToCurrentDesktop( | 121 multi_user_util::MoveWindowToCurrentDesktop( |
| 122 displayer.browser()->window()->GetNativeWindow()); | 122 displayer.browser()->window()->GetNativeWindow()); |
| 123 } | 123 } |
| 124 | 124 |
| 125 // Reads the alternate URL from a GDoc file. When it fails, returns a file URL | 125 // Reads the alternate URL from a GDoc file. When it fails, returns a file URL |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 base::FilePath::FromUTF8Unsafe("dummy").AddExtension(file_extension); | 191 base::FilePath::FromUTF8Unsafe("dummy").AddExtension(file_extension); |
| 192 if (file_path.MatchesExtension(kPdfExtension)) | 192 if (file_path.MatchesExtension(kPdfExtension)) |
| 193 return IsPdfPluginEnabled(profile); | 193 return IsPdfPluginEnabled(profile); |
| 194 if (file_path.MatchesExtension(kSwfExtension)) | 194 if (file_path.MatchesExtension(kSwfExtension)) |
| 195 return IsFlashPluginEnabled(profile); | 195 return IsFlashPluginEnabled(profile); |
| 196 return false; | 196 return false; |
| 197 } | 197 } |
| 198 | 198 |
| 199 } // namespace util | 199 } // namespace util |
| 200 } // namespace file_manager | 200 } // namespace file_manager |
| OLD | NEW |