| 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 | 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 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 924 int handler_pid_in, | 924 int handler_pid_in, |
| 925 extensions::ExtensionHost* host) { | 925 extensions::ExtensionHost* host) { |
| 926 int handler_pid = host ? host->render_process_host()->GetID() : | 926 int handler_pid = host ? host->render_process_host()->GetID() : |
| 927 handler_pid_in; | 927 handler_pid_in; |
| 928 | 928 |
| 929 if (handler_pid <= 0) { | 929 if (handler_pid <= 0) { |
| 930 ExecuteDoneOnUIThread(false); | 930 ExecuteDoneOnUIThread(false); |
| 931 return; | 931 return; |
| 932 } | 932 } |
| 933 | 933 |
| 934 extensions::EventRouter* event_router = profile()->GetExtensionEventRouter(); | 934 extensions::EventRouter* event_router = |
| 935 extensions::ExtensionSystem::Get(profile())->event_router(); |
| 935 if (!event_router) { | 936 if (!event_router) { |
| 936 ExecuteDoneOnUIThread(false); | 937 ExecuteDoneOnUIThread(false); |
| 937 return; | 938 return; |
| 938 } | 939 } |
| 939 | 940 |
| 940 SetupHandlerHostFileAccessPermissions(handler_pid); | 941 SetupHandlerHostFileAccessPermissions(handler_pid); |
| 941 | 942 |
| 942 scoped_ptr<ListValue> event_args(new ListValue()); | 943 scoped_ptr<ListValue> event_args(new ListValue()); |
| 943 event_args->Append(Value::CreateStringValue(action_id_)); | 944 event_args->Append(Value::CreateStringValue(action_id_)); |
| 944 DictionaryValue* details = new DictionaryValue(); | 945 DictionaryValue* details = new DictionaryValue(); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1059 // Make sure this url really being used by the right caller extension. | 1060 // Make sure this url really being used by the right caller extension. |
| 1060 if (source_url_.GetOrigin() != url.origin()) | 1061 if (source_url_.GetOrigin() != url.origin()) |
| 1061 return false; | 1062 return false; |
| 1062 | 1063 |
| 1063 FilePath local_path = url.path(); | 1064 FilePath local_path = url.path(); |
| 1064 extensions::LaunchPlatformAppWithPath(profile(), GetExtension(), local_path); | 1065 extensions::LaunchPlatformAppWithPath(profile(), GetExtension(), local_path); |
| 1065 return true; | 1066 return true; |
| 1066 } | 1067 } |
| 1067 | 1068 |
| 1068 } // namespace file_handler_util | 1069 } // namespace file_handler_util |
| OLD | NEW |