Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: chrome/browser/chromeos/extensions/file_manager_util.cc

Issue 9692049: Gave native File Browser file handlers higher priority than 3rd party handlers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698