OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/api/runtime/runtime_api.h" | 5 #include "extensions/browser/api/runtime/runtime_api.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 DCHECK(system->event_router()); | 364 DCHECK(system->event_router()); |
365 scoped_ptr<Event> event( | 365 scoped_ptr<Event> event( |
366 new Event(runtime::OnBrowserUpdateAvailable::kEventName, args.Pass())); | 366 new Event(runtime::OnBrowserUpdateAvailable::kEventName, args.Pass())); |
367 system->event_router()->BroadcastEvent(event.Pass()); | 367 system->event_router()->BroadcastEvent(event.Pass()); |
368 } | 368 } |
369 | 369 |
370 // static | 370 // static |
371 void RuntimeEventRouter::DispatchOnRestartRequiredEvent( | 371 void RuntimeEventRouter::DispatchOnRestartRequiredEvent( |
372 content::BrowserContext* context, | 372 content::BrowserContext* context, |
373 const std::string& app_id, | 373 const std::string& app_id, |
374 core_api::runtime::OnRestartRequired::Reason reason) { | 374 core_api::runtime::OnRestartRequiredReason reason) { |
375 ExtensionSystem* system = ExtensionSystem::Get(context); | 375 ExtensionSystem* system = ExtensionSystem::Get(context); |
376 if (!system) | 376 if (!system) |
377 return; | 377 return; |
378 | 378 |
379 scoped_ptr<Event> event( | 379 scoped_ptr<Event> event( |
380 new Event(runtime::OnRestartRequired::kEventName, | 380 new Event(runtime::OnRestartRequired::kEventName, |
381 core_api::runtime::OnRestartRequired::Create(reason))); | 381 core_api::runtime::OnRestartRequired::Create(reason))); |
382 | 382 |
383 DCHECK(system->event_router()); | 383 DCHECK(system->event_router()); |
384 system->event_router()->DispatchEventToExtension(app_id, event.Pass()); | 384 system->event_router()->DispatchEventToExtension(app_id, event.Pass()); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 content::ChildProcessSecurityPolicy* policy = | 518 content::ChildProcessSecurityPolicy* policy = |
519 content::ChildProcessSecurityPolicy::GetInstance(); | 519 content::ChildProcessSecurityPolicy::GetInstance(); |
520 policy->GrantReadFileSystem(renderer_id, filesystem_id); | 520 policy->GrantReadFileSystem(renderer_id, filesystem_id); |
521 base::DictionaryValue* dict = new base::DictionaryValue(); | 521 base::DictionaryValue* dict = new base::DictionaryValue(); |
522 dict->SetString("fileSystemId", filesystem_id); | 522 dict->SetString("fileSystemId", filesystem_id); |
523 dict->SetString("baseName", relative_path); | 523 dict->SetString("baseName", relative_path); |
524 return RespondNow(OneArgument(dict)); | 524 return RespondNow(OneArgument(dict)); |
525 } | 525 } |
526 | 526 |
527 } // namespace extensions | 527 } // namespace extensions |
OLD | NEW |