Index: third_party/WebKit/Source/modules/ballista/NavigatorActions.cpp |
diff --git a/third_party/WebKit/Source/modules/ballista/NavigatorActions.cpp b/third_party/WebKit/Source/modules/ballista/NavigatorActions.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..48f07c90879271c979a045bc2a2e3c8818d49239 |
--- /dev/null |
+++ b/third_party/WebKit/Source/modules/ballista/NavigatorActions.cpp |
@@ -0,0 +1,51 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "config.h" |
+#include "modules/ballista/NavigatorActions.h" |
+ |
+#include "core/frame/Navigator.h" |
+#include "modules/ballista/Actions.h" |
+ |
+namespace blink { |
+ |
+NavigatorActions& NavigatorActions::from(Navigator& navigator) |
+{ |
+ NavigatorActions* supplement = static_cast<NavigatorActions*>(HeapSupplement |
+<Navigator>::from(navigator, supplementName())); |
+ if (!supplement) { |
+ supplement = new NavigatorActions(); |
+ provideTo(navigator, supplementName(), supplement); |
+ } |
+ return *supplement; |
+} |
+ |
+Actions* NavigatorActions::actions(Navigator& navigator) |
+{ |
+ return NavigatorActions::from(navigator).actions(); |
+} |
+ |
+Actions* NavigatorActions::actions() |
+{ |
+ if (!m_actions) |
+ m_actions = Actions::create(); |
+ return m_actions.get(); |
+} |
+ |
+DEFINE_TRACE(NavigatorActions) |
+{ |
+ visitor->trace(m_actions); |
+ HeapSupplement<Navigator>::trace(visitor); |
+} |
+ |
+NavigatorActions::NavigatorActions() |
+{ |
+} |
+ |
+const char* NavigatorActions::supplementName() |
+{ |
+ return "NavigatorActions"; |
+} |
+ |
+} // namespace blink |