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

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

Issue 10908262: [cros] disable GDrive option on certain file pickers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: invert default in file manager Created 8 years, 3 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 | chrome/browser/download/download_file_picker.cc » ('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 (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/file_util.h" 7 #include "base/file_util.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 dict->SetBoolean("selected", 349 dict->SetBoolean("selected",
350 (static_cast<size_t>(file_type_index) == (i + 1))); 350 (static_cast<size_t>(file_type_index) == (i + 1)));
351 351
352 types_list->Set(i, dict); 352 types_list->Set(i, dict);
353 } 353 }
354 arg_value.Set("typeList", types_list); 354 arg_value.Set("typeList", types_list);
355 355
356 arg_value.SetBoolean("includeAllFiles", file_types->include_all_files); 356 arg_value.SetBoolean("includeAllFiles", file_types->include_all_files);
357 } 357 }
358 358
359 // Disable showing GDrive unless it's specifically supported.
360 arg_value.SetBoolean("disableGData",
361 !file_types || !file_types->support_gdata);
362
359 std::string json_args; 363 std::string json_args;
360 base::JSONWriter::Write(&arg_value, &json_args); 364 base::JSONWriter::Write(&arg_value, &json_args);
361 365
362 // kChromeUIFileManagerURL could not be used since query parameters are not 366 // kChromeUIFileManagerURL could not be used since query parameters are not
363 // supported for it. 367 // supported for it.
364 std::string url = GetFileBrowserUrl().spec() + 368 std::string url = GetFileBrowserUrl().spec() +
365 '?' + net::EscapeUrlEncodedData(json_args, false); 369 '?' + net::EscapeUrlEncodedData(json_args, false);
366 return GURL(url); 370 return GURL(url);
367 } 371 }
368 372
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 OperationRegistry::ProgressStatus>::const_iterator iter = 782 OperationRegistry::ProgressStatus>::const_iterator iter =
779 list.begin(); 783 list.begin();
780 iter != list.end(); ++iter) { 784 iter != list.end(); ++iter) {
781 result_list->Append( 785 result_list->Append(
782 ProgessStatusToDictionaryValue(profile, origin_url, *iter)); 786 ProgessStatusToDictionaryValue(profile, origin_url, *iter));
783 } 787 }
784 return result_list.release(); 788 return result_list.release();
785 } 789 }
786 790
787 } // namespace file_manager_util 791 } // namespace file_manager_util
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/download/download_file_picker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698