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