| 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/platform_util.h" | 5 #include "chrome/browser/platform_util.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/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/process/kill.h" | 10 #include "base/process/kill.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // between the time the utility process changes into the directory and the | 148 // between the time the utility process changes into the directory and the |
| 149 // time the application invoked by xdg-open inspects the path by name. | 149 // time the application invoked by xdg-open inspects the path by name. |
| 150 XDGOpen(path, "."); | 150 XDGOpen(path, "."); |
| 151 break; | 151 break; |
| 152 case SHOW_ITEM_IN_FOLDER: | 152 case SHOW_ITEM_IN_FOLDER: |
| 153 ShowFileInNautilus(path.DirName(), path.value()); | 153 ShowFileInNautilus(path.DirName(), path.value()); |
| 154 break; | 154 break; |
| 155 } | 155 } |
| 156 } | 156 } |
| 157 | 157 |
| 158 } // namespace internal | 158 void PlatformShowItemInFolder(Profile* profile, |
| 159 | 159 const base::FilePath& full_path) { |
| 160 void ShowItemInFolder(Profile* profile, const base::FilePath& full_path) { | |
| 161 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 160 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 162 base::PostTaskAndReplyWithResult(content::BrowserThread::GetBlockingPool(), | 161 base::PostTaskAndReplyWithResult(content::BrowserThread::GetBlockingPool(), |
| 163 FROM_HERE, | 162 FROM_HERE, |
| 164 base::Bind(&CheckNautilusIsDefault), | 163 base::Bind(&CheckNautilusIsDefault), |
| 165 base::Bind(&ShowItem, profile, full_path)); | 164 base::Bind(&ShowItem, profile, full_path)); |
| 166 } | 165 } |
| 167 | 166 |
| 167 } // namespace internal |
| 168 |
| 168 void OpenExternal(Profile* profile, const GURL& url) { | 169 void OpenExternal(Profile* profile, const GURL& url) { |
| 169 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 170 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 170 if (url.SchemeIs("mailto")) | 171 if (url.SchemeIs("mailto")) |
| 171 XDGEmail(url.spec()); | 172 XDGEmail(url.spec()); |
| 172 else | 173 else |
| 173 XDGOpen(base::FilePath(), url.spec()); | 174 XDGOpen(base::FilePath(), url.spec()); |
| 174 } | 175 } |
| 175 | 176 |
| 176 } // namespace platform_util | 177 } // namespace platform_util |
| OLD | NEW |