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

Side by Side Diff: chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc

Issue 471903002: Video Player: Disables cast feature by default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed the comment Created 6 years, 4 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
« no previous file with comments | « no previous file | ui/file_manager/video_player/js/cast/caster.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/extensions/file_manager/private_api_drive.h" 5 #include "chrome/browser/chromeos/extensions/file_manager/private_api_drive.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/chromeos/drive/drive_integration_service.h" 9 #include "chrome/browser/chromeos/drive/drive_integration_service.h"
10 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" 10 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h"
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 895
896 FileBrowserPrivateGetDownloadUrlFunction:: 896 FileBrowserPrivateGetDownloadUrlFunction::
897 FileBrowserPrivateGetDownloadUrlFunction() { 897 FileBrowserPrivateGetDownloadUrlFunction() {
898 } 898 }
899 899
900 FileBrowserPrivateGetDownloadUrlFunction:: 900 FileBrowserPrivateGetDownloadUrlFunction::
901 ~FileBrowserPrivateGetDownloadUrlFunction() { 901 ~FileBrowserPrivateGetDownloadUrlFunction() {
902 } 902 }
903 903
904 bool FileBrowserPrivateGetDownloadUrlFunction::RunAsync() { 904 bool FileBrowserPrivateGetDownloadUrlFunction::RunAsync() {
905 const base::CommandLine* command_line =
906 base::CommandLine::ForCurrentProcess();
907 if (!command_line->HasSwitch(
908 chromeos::switches::kEnableVideoPlayerChromecastSupport)) {
909 SetError("Cast support is disabled.");
910 SetResult(new base::StringValue("")); // Intentionally returns a blank.
911 return false;
912 }
913
905 using extensions::api::file_browser_private::GetShareUrl::Params; 914 using extensions::api::file_browser_private::GetShareUrl::Params;
906 const scoped_ptr<Params> params(Params::Create(*args_)); 915 const scoped_ptr<Params> params(Params::Create(*args_));
907 EXTENSION_FUNCTION_VALIDATE(params); 916 EXTENSION_FUNCTION_VALIDATE(params);
908 917
909 // Start getting the file info. 918 // Start getting the file info.
910 drive::FileSystemInterface* const file_system = 919 drive::FileSystemInterface* const file_system =
911 drive::util::GetFileSystemByProfile(GetProfile()); 920 drive::util::GetFileSystemByProfile(GetProfile());
912 if (!file_system) { 921 if (!file_system) {
913 // |file_system| is NULL if Drive is disabled or not mounted. 922 // |file_system| is NULL if Drive is disabled or not mounted.
914 SetError("Drive is disabled or not mounted."); 923 SetError("Drive is disabled or not mounted.");
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 return; 984 return;
976 } 985 }
977 986
978 const std::string url = download_url_ + "?access_token=" + access_token; 987 const std::string url = download_url_ + "?access_token=" + access_token;
979 SetResult(new base::StringValue(url)); 988 SetResult(new base::StringValue(url));
980 989
981 SendResponse(true); 990 SendResponse(true);
982 } 991 }
983 992
984 } // namespace extensions 993 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | ui/file_manager/video_player/js/cast/caster.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698