| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "modules/installedapp/InstalledAppController.h" | 5 #include "modules/installedapp/InstalledAppController.h" |
| 6 | 6 |
| 7 #include "core/frame/LocalFrame.h" | 7 #include "core/frame/LocalFrame.h" |
| 8 #include "platform/RuntimeEnabledFeatures.h" | 8 #include "platform/RuntimeEnabledFeatures.h" |
| 9 #include "public/platform/WebSecurityOrigin.h" | 9 #include "public/platform/WebSecurityOrigin.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 InstalledAppController::~InstalledAppController() | 13 InstalledAppController::~InstalledAppController() |
| 14 { | 14 { |
| 15 } | 15 } |
| 16 | 16 |
| 17 void InstalledAppController::provideTo(LocalFrame& frame, WebInstalledAppClient*
client) | 17 void InstalledAppController::provideTo(LocalFrame& frame, WebInstalledAppClient*
client) |
| 18 { | 18 { |
| 19 ASSERT(RuntimeEnabledFeatures::installedAppEnabled()); | 19 ASSERT(RuntimeEnabledFeatures::installedAppEnabled()); |
| 20 | 20 |
| 21 RawPtr<InstalledAppController> controller = new InstalledAppController(frame
, client); | 21 RawPtr<InstalledAppController> controller = new InstalledAppController(frame
, client); |
| 22 HeapSupplement<LocalFrame>::provideTo(frame, supplementName(), controller.re
lease()); | 22 Supplement<LocalFrame>::provideTo(frame, supplementName(), controller.releas
e()); |
| 23 } | 23 } |
| 24 | 24 |
| 25 InstalledAppController* InstalledAppController::from(LocalFrame& frame) | 25 InstalledAppController* InstalledAppController::from(LocalFrame& frame) |
| 26 { | 26 { |
| 27 InstalledAppController* controller = static_cast<InstalledAppController*>(He
apSupplement<LocalFrame>::from(frame, supplementName())); | 27 InstalledAppController* controller = static_cast<InstalledAppController*>(Su
pplement<LocalFrame>::from(frame, supplementName())); |
| 28 ASSERT(controller); | 28 ASSERT(controller); |
| 29 return controller; | 29 return controller; |
| 30 } | 30 } |
| 31 | 31 |
| 32 InstalledAppController::InstalledAppController(LocalFrame& frame, WebInstalledAp
pClient* client) | 32 InstalledAppController::InstalledAppController(LocalFrame& frame, WebInstalledAp
pClient* client) |
| 33 : LocalFrameLifecycleObserver(&frame) | 33 : LocalFrameLifecycleObserver(&frame) |
| 34 , m_client(client) | 34 , m_client(client) |
| 35 { | 35 { |
| 36 } | 36 } |
| 37 | 37 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 52 m_client->getInstalledRelatedApps(url, callback); | 52 m_client->getInstalledRelatedApps(url, callback); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void InstalledAppController::willDetachFrameHost() | 55 void InstalledAppController::willDetachFrameHost() |
| 56 { | 56 { |
| 57 m_client = nullptr; | 57 m_client = nullptr; |
| 58 } | 58 } |
| 59 | 59 |
| 60 DEFINE_TRACE(InstalledAppController) | 60 DEFINE_TRACE(InstalledAppController) |
| 61 { | 61 { |
| 62 HeapSupplement<LocalFrame>::trace(visitor); | 62 Supplement<LocalFrame>::trace(visitor); |
| 63 LocalFrameLifecycleObserver::trace(visitor); | 63 LocalFrameLifecycleObserver::trace(visitor); |
| 64 } | 64 } |
| 65 | 65 |
| 66 } // namespace blink | 66 } // namespace blink |
| OLD | NEW |