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

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

Issue 10694085: Refactor extension event distribution to use Values instead of JSON strings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and review changes. Created 8 years, 5 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 4
5 #include "chrome/browser/chromeos/extensions/file_handler_util.h" 5 #include "chrome/browser/chromeos/extensions/file_handler_util.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/i18n/case_conversion.h" 9 #include "base/i18n/case_conversion.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 return; 804 return;
805 } 805 }
806 806
807 SetupHandlerHostFileAccessPermissions(handler_pid); 807 SetupHandlerHostFileAccessPermissions(handler_pid);
808 808
809 scoped_ptr<ListValue> event_args(new ListValue()); 809 scoped_ptr<ListValue> event_args(new ListValue());
810 event_args->Append(Value::CreateStringValue(action_id_)); 810 event_args->Append(Value::CreateStringValue(action_id_));
811 DictionaryValue* details = new DictionaryValue(); 811 DictionaryValue* details = new DictionaryValue();
812 event_args->Append(details); 812 event_args->Append(details);
813 // Get file definitions. These will be replaced with Entry instances by 813 // Get file definitions. These will be replaced with Entry instances by
814 // chromeHidden.Event.dispatchJSON() method from even_binding.js. 814 // chromeHidden.Event.dispatch() method from event_binding.js.
815 ListValue* files_urls = new ListValue(); 815 ListValue* files_urls = new ListValue();
816 details->Set("entries", files_urls); 816 details->Set("entries", files_urls);
817 for (FileDefinitionList::const_iterator iter = file_list.begin(); 817 for (FileDefinitionList::const_iterator iter = file_list.begin();
818 iter != file_list.end(); 818 iter != file_list.end();
819 ++iter) { 819 ++iter) {
820 DictionaryValue* file_def = new DictionaryValue(); 820 DictionaryValue* file_def = new DictionaryValue();
821 files_urls->Append(file_def); 821 files_urls->Append(file_def);
822 file_def->SetString("fileSystemName", file_system_name); 822 file_def->SetString("fileSystemName", file_system_name);
823 file_def->SetString("fileSystemRoot", file_system_root.spec()); 823 file_def->SetString("fileSystemRoot", file_system_root.spec());
824 FilePath root(FILE_PATH_LITERAL("/")); 824 FilePath root(FILE_PATH_LITERAL("/"));
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 handler_pid, 884 handler_pid,
885 handler_host_permissions_[i].first, 885 handler_host_permissions_[i].first,
886 handler_host_permissions_[i].second); 886 handler_host_permissions_[i].second);
887 } 887 }
888 888
889 // We don't need this anymore. 889 // We don't need this anymore.
890 handler_host_permissions_.clear(); 890 handler_host_permissions_.clear();
891 } 891 }
892 892
893 } // namespace file_handler_util 893 } // namespace file_handler_util
894
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698