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 #include "chrome/browser/chromeos/extensions/file_manager_util.h" | 4 #include "chrome/browser/chromeos/extensions/file_manager_util.h" |
5 | 5 |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 Browser* browser = BrowserList::GetLastActive(); | 359 Browser* browser = BrowserList::GetLastActive(); |
360 if (!browser) | 360 if (!browser) |
361 return false; | 361 return false; |
362 | 362 |
363 GURL url; | 363 GURL url; |
364 if (!ConvertFileToFileSystemUrl(browser->profile(), full_path, | 364 if (!ConvertFileToFileSystemUrl(browser->profile(), full_path, |
365 GetFileBrowserExtensionUrl().GetOrigin(), &url)) | 365 GetFileBrowserExtensionUrl().GetOrigin(), &url)) |
366 return false; | 366 return false; |
367 | 367 |
368 const FileBrowserHandler* handler; | 368 const FileBrowserHandler* handler; |
369 if (!file_handler_util::GetDefaultTask(browser->profile(), url, &handler)) | 369 if (!file_handler_util::GetDefaultTask( |
| 370 browser->profile(), url, kFileBrowserDomain, &handler)) |
370 return false; | 371 return false; |
371 | 372 |
372 std::string extension_id = handler->extension_id(); | 373 std::string extension_id = handler->extension_id(); |
373 std::string action_id = handler->id(); | 374 std::string action_id = handler->id(); |
374 if (extension_id == kFileBrowserDomain) { | 375 if (extension_id == kFileBrowserDomain) { |
375 // Only two of the built-in File Browser tasks require opening the File | 376 // Only two of the built-in File Browser tasks require opening the File |
376 // Browser tab. Others just end up calling TryViewingFile. | 377 // Browser tab. Others just end up calling TryViewingFile. |
377 if (action_id == kFileBrowserGalleryTaskId || | 378 if (action_id == kFileBrowserGalleryTaskId || |
378 action_id == kFileBrowserMountArchiveTaskId) { | 379 action_id == kFileBrowserMountArchiveTaskId) { |
379 OpenFileBrowser(full_path); | 380 OpenFileBrowser(full_path); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 return false; | 477 return false; |
477 | 478 |
478 PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(browser->profile()); | 479 PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(browser->profile()); |
479 if (!plugin_prefs) | 480 if (!plugin_prefs) |
480 return false; | 481 return false; |
481 | 482 |
482 return plugin_prefs->IsPluginEnabled(plugin); | 483 return plugin_prefs->IsPluginEnabled(plugin); |
483 } | 484 } |
484 | 485 |
485 } // namespace file_manager_util | 486 } // namespace file_manager_util |
OLD | NEW |