| 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/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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |