| 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 #ifndef CONTENT_RENDERER_MOJO_BINDINGS_CONTROLLER_H_ | 5 #ifndef CONTENT_RENDERER_MOJO_BINDINGS_CONTROLLER_H_ |
| 6 #define CONTENT_RENDERER_MOJO_BINDINGS_CONTROLLER_H_ | 6 #define CONTENT_RENDERER_MOJO_BINDINGS_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 class MojoContextState; | 21 class MojoContextState; |
| 22 | 22 |
| 23 // MojoBindingsController is responsible for enabling the renderer side of mojo | 23 // MojoBindingsController is responsible for enabling the renderer side of mojo |
| 24 // bindings. It creates (and destroys) a MojoContextState at the appropriate | 24 // bindings. It creates (and destroys) a MojoContextState at the appropriate |
| 25 // times and handles the necessary browser messages. MojoBindingsController | 25 // times and handles the necessary browser messages. MojoBindingsController |
| 26 // destroys itself when the RendererFrame it is created with is destroyed. | 26 // destroys itself when the RendererFrame it is created with is destroyed. |
| 27 class MojoBindingsController | 27 class MojoBindingsController |
| 28 : public RenderFrameObserver, | 28 : public RenderFrameObserver, |
| 29 public RenderFrameObserverTracker<MojoBindingsController> { | 29 public RenderFrameObserverTracker<MojoBindingsController> { |
| 30 public: | 30 public: |
| 31 explicit MojoBindingsController(RenderFrame* render_frame); | 31 MojoBindingsController(RenderFrame* render_frame, bool for_layout_tests); |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 ~MojoBindingsController() override; | 34 ~MojoBindingsController() override; |
| 35 | 35 |
| 36 void CreateContextState(); | 36 void CreateContextState(); |
| 37 void DestroyContextState(v8::Local<v8::Context> context); | 37 void DestroyContextState(v8::Local<v8::Context> context); |
| 38 MojoContextState* GetContextState(); | 38 MojoContextState* GetContextState(); |
| 39 | 39 |
| 40 // RenderFrameObserver overrides: | 40 // RenderFrameObserver overrides: |
| 41 void WillReleaseScriptContext(v8::Local<v8::Context> context, | 41 void WillReleaseScriptContext(v8::Local<v8::Context> context, |
| 42 int world_id) override; | 42 int world_id) override; |
| 43 void DidFinishDocumentLoad() override; | 43 void DidFinishDocumentLoad() override; |
| 44 void DidCreateDocumentElement() override; | 44 void DidCreateDocumentElement() override; |
| 45 void DidClearWindowObject() override; | 45 void DidClearWindowObject() override; |
| 46 | 46 |
| 47 const bool for_layout_tests_; |
| 48 |
| 47 DISALLOW_COPY_AND_ASSIGN(MojoBindingsController); | 49 DISALLOW_COPY_AND_ASSIGN(MojoBindingsController); |
| 48 }; | 50 }; |
| 49 | 51 |
| 50 } // namespace content | 52 } // namespace content |
| 51 | 53 |
| 52 #endif // CONTENT_RENDERER_MOJO_BINDINGS_CONTROLLER_H_ | 54 #endif // CONTENT_RENDERER_MOJO_BINDINGS_CONTROLLER_H_ |
| OLD | NEW |