diff options
Diffstat (limited to 'components/web_view')
-rw-r--r-- | components/web_view/frame.cc | 12 | ||||
-rw-r--r-- | components/web_view/frame.h | 24 | ||||
-rw-r--r-- | components/web_view/frame_apptest.cc | 22 | ||||
-rw-r--r-- | components/web_view/frame_tree.cc | 4 | ||||
-rw-r--r-- | components/web_view/frame_tree.h | 4 | ||||
-rw-r--r-- | components/web_view/frame_tree_delegate.h | 2 | ||||
-rw-r--r-- | components/web_view/public/cpp/web_view.cc | 2 | ||||
-rw-r--r-- | components/web_view/public/cpp/web_view.h | 5 | ||||
-rw-r--r-- | components/web_view/test_runner/test_runner_application_delegate.cc | 12 | ||||
-rw-r--r-- | components/web_view/test_runner/test_runner_application_delegate.h | 12 | ||||
-rw-r--r-- | components/web_view/web_view_apptest.cc | 8 | ||||
-rw-r--r-- | components/web_view/web_view_impl.cc | 16 | ||||
-rw-r--r-- | components/web_view/web_view_impl.h | 20 |
13 files changed, 70 insertions, 73 deletions
diff --git a/components/web_view/frame.cc b/components/web_view/frame.cc index 1097388..5f30640 100644 --- a/components/web_view/frame.cc +++ b/components/web_view/frame.cc @@ -18,7 +18,7 @@ #include "components/web_view/frame_utils.h" #include "mojo/application/public/interfaces/shell.mojom.h" -using mus::View; +using mojo::View; DECLARE_VIEW_PROPERTY_TYPE(web_view::Frame*); @@ -30,7 +30,7 @@ DEFINE_LOCAL_VIEW_PROPERTY_KEY(Frame*, kFrame, nullptr); namespace { const uint32_t kNoParentId = 0u; -const mus::ConnectionSpecificId kInvalidConnectionId = 0u; +const mojo::ConnectionSpecificId kInvalidConnectionId = 0u; FrameDataPtr FrameToFrameData(const Frame* frame) { FrameDataPtr frame_data(FrameData::New()); @@ -219,12 +219,12 @@ void Frame::ChangeClient(FrameTreeClient* frame_tree_client, view_tree_client.Pass()); } -void Frame::OnEmbedAck(bool success, mus::ConnectionSpecificId connection_id) { +void Frame::OnEmbedAck(bool success, mojo::ConnectionSpecificId connection_id) { if (success) embedded_connection_id_ = connection_id; } -void Frame::SetView(mus::View* view) { +void Frame::SetView(mojo::View* view) { DCHECK(!view_); DCHECK_EQ(id_, view->id()); view_ = view; @@ -407,7 +407,7 @@ void Frame::OnTreeChanged(const TreeChangeParams& params) { } } -void Frame::OnViewDestroying(mus::View* view) { +void Frame::OnViewDestroying(mojo::View* view) { if (parent_) parent_->Remove(this); @@ -424,7 +424,7 @@ void Frame::OnViewDestroying(mus::View* view) { delete this; } -void Frame::OnViewEmbeddedAppDisconnected(mus::View* view) { +void Frame::OnViewEmbeddedAppDisconnected(mojo::View* view) { // See FrameTreeDelegate::OnViewEmbeddedAppDisconnected() for details of when // this happens. // diff --git a/components/web_view/frame.h b/components/web_view/frame.h index 2951562..fbf4a78 100644 --- a/components/web_view/frame.h +++ b/components/web_view/frame.h @@ -49,12 +49,12 @@ enum class ViewOwnership { // by the argument |reuse_existing_view| supplied to OnConnect(). Typically the // id is that of content handler id, but this is left up to the // FrameTreeDelegate to decide. -class Frame : public mus::ViewObserver, public FrameTreeServer { +class Frame : public mojo::ViewObserver, public FrameTreeServer { public: using ClientPropertyMap = std::map<std::string, std::vector<uint8_t>>; Frame(FrameTree* tree, - mus::View* view, + mojo::View* view, uint32_t frame_id, uint32_t app_id, ViewOwnership view_ownership, @@ -69,15 +69,15 @@ class Frame : public mus::ViewObserver, public FrameTreeServer { // Frame that is associated with |view|. For example, if |view| // has a Frame associated with it, then that is returned. Otherwise // this checks view->parent() and so on. - static Frame* FindFirstFrameAncestor(mus::View* view); + static Frame* FindFirstFrameAncestor(mojo::View* view); FrameTree* tree() { return tree_; } Frame* parent() { return parent_; } const Frame* parent() const { return parent_; } - mus::View* view() { return view_; } - const mus::View* view() const { return view_; } + mojo::View* view() { return view_; } + const mojo::View* view() const { return view_; } uint32_t id() const { return id_; } @@ -137,7 +137,7 @@ class Frame : public mus::ViewObserver, public FrameTreeServer { scoped_ptr<FrameTreeServerBinding> frame_tree_server_binding); // Callback from OnEmbed(). - void OnEmbedAck(bool success, mus::ConnectionSpecificId connection_id); + void OnEmbedAck(bool success, mojo::ConnectionSpecificId connection_id); // Completes a navigation request; swapping the existing FrameTreeClient to // the supplied arguments. @@ -146,7 +146,7 @@ class Frame : public mus::ViewObserver, public FrameTreeServer { mojo::ViewTreeClientPtr view_tree_client, uint32 app_id); - void SetView(mus::View* view); + void SetView(mojo::View* view); // Returns the first ancestor (starting at |this|) that has a // FrameTreeClient. @@ -192,10 +192,10 @@ class Frame : public mus::ViewObserver, public FrameTreeServer { const mojo::String& name, const mojo::Array<uint8_t>& value); - // mus::ViewObserver: + // mojo::ViewObserver: void OnTreeChanged(const TreeChangeParams& params) override; - void OnViewDestroying(mus::View* view) override; - void OnViewEmbeddedAppDisconnected(mus::View* view) override; + void OnViewDestroying(mojo::View* view) override; + void OnViewEmbeddedAppDisconnected(mojo::View* view) override; // FrameTreeServer: void PostMessageEventToFrame(uint32_t source_frame_id, @@ -219,10 +219,10 @@ class Frame : public mus::ViewObserver, public FrameTreeServer { FrameTree* const tree_; // WARNING: this may be null. See class description for details. - mus::View* view_; + mojo::View* view_; // The connection id returned from ViewManager::Embed(). Frames created by // way of OnCreatedFrame() inherit the id from the parent. - mus::ConnectionSpecificId embedded_connection_id_; + mojo::ConnectionSpecificId embedded_connection_id_; // ID for the frame, which is the same as that of the view. const uint32_t id_; // ID of the app providing the FrameTreeClient and ViewTreeClient. diff --git a/components/web_view/frame_apptest.cc b/components/web_view/frame_apptest.cc index 99fb2e2..2526bd8 100644 --- a/components/web_view/frame_apptest.cc +++ b/components/web_view/frame_apptest.cc @@ -26,8 +26,8 @@ #include "mojo/application/public/cpp/application_test_base.h" #include "mojo/application/public/cpp/service_provider_impl.h" -using mus::View; -using mus::ViewTreeConnection; +using mojo::View; +using mojo::ViewTreeConnection; namespace web_view { @@ -141,7 +141,7 @@ class FrameTest; // a single FrameTreeClient. In other words this maintains the data structures // needed to represent a client side frame. To obtain one use // FrameTest::WaitForViewAndFrame(). -class ViewAndFrame : public mus::ViewTreeDelegate { +class ViewAndFrame : public mojo::ViewTreeDelegate { public: ~ViewAndFrame() override { if (view_) @@ -149,7 +149,7 @@ class ViewAndFrame : public mus::ViewTreeDelegate { } // The View associated with the frame. - mus::View* view() { return view_; } + mojo::View* view() { return view_; } TestFrameTreeClient* test_frame_tree_client() { return &test_frame_tree_client_; } @@ -189,7 +189,7 @@ class ViewAndFrame : public mus::ViewTreeDelegate { view_ = nullptr; } - mus::View* view_; + mojo::View* view_; base::RunLoop run_loop_; TestFrameTreeClient test_frame_tree_client_; mojo::Binding<FrameTreeClient> frame_tree_binding_; @@ -199,7 +199,7 @@ class ViewAndFrame : public mus::ViewTreeDelegate { class FrameTest : public mojo::test::ApplicationTestBase, public mojo::ApplicationDelegate, - public mus::ViewTreeDelegate, + public mojo::ViewTreeDelegate, public mojo::InterfaceFactory<mojo::ViewTreeClient>, public mojo::InterfaceFactory<FrameTreeClient> { public: @@ -223,7 +223,7 @@ class FrameTest : public mojo::test::ApplicationTestBase, // Creates a new shared frame as a child of |parent|. Frame* CreateSharedFrame(ViewAndFrame* parent) { - mus::View* child_frame_view = parent->view()->connection()->CreateView(); + mojo::View* child_frame_view = parent->view()->connection()->CreateView(); parent->view()->AddChild(child_frame_view); mojo::Map<mojo::String, mojo::Array<uint8_t>> client_properties; client_properties.mark_non_null(); @@ -281,7 +281,7 @@ class FrameTest : public mojo::test::ApplicationTestBase, void SetUp() override { ApplicationTestBase::SetUp(); - mus::CreateSingleViewTreeHost(application_impl(), this, &host_); + mojo::CreateSingleViewTreeHost(application_impl(), this, &host_); ASSERT_TRUE(DoRunLoopWithTimeout()); std::swap(window_manager_, most_recent_connection_); @@ -294,7 +294,7 @@ class FrameTest : public mojo::test::ApplicationTestBase, FrameTreeClient* frame_tree_client = frame_connection->frame_tree_client(); mojo::ViewTreeClientPtr view_tree_client = frame_connection->GetViewTreeClient(); - mus::View* frame_root_view = window_manager()->CreateView(); + mojo::View* frame_root_view = window_manager()->CreateView(); window_manager()->GetRoot()->AddChild(frame_root_view); frame_tree_.reset( new FrameTree(0u, frame_root_view, view_tree_client.Pass(), @@ -316,9 +316,9 @@ class FrameTest : public mojo::test::ApplicationTestBase, mojo::ApplicationConnection* connection, mojo::InterfaceRequest<mojo::ViewTreeClient> request) override { if (view_and_frame_) { - mus::ViewTreeConnection::Create(view_and_frame_.get(), request.Pass()); + mojo::ViewTreeConnection::Create(view_and_frame_.get(), request.Pass()); } else { - mus::ViewTreeConnection::Create(this, request.Pass()); + mojo::ViewTreeConnection::Create(this, request.Pass()); } } diff --git a/components/web_view/frame_tree.cc b/components/web_view/frame_tree.cc index c82ebfb..eee41c1 100644 --- a/components/web_view/frame_tree.cc +++ b/components/web_view/frame_tree.cc @@ -10,7 +10,7 @@ namespace web_view { FrameTree::FrameTree(uint32_t root_app_id, - mus::View* view, + mojo::View* view, mojo::ViewTreeClientPtr view_tree_client, FrameTreeDelegate* delegate, FrameTreeClient* root_client, @@ -43,7 +43,7 @@ Frame* FrameTree::CreateSharedFrame( uint32_t frame_id, uint32_t app_id, const Frame::ClientPropertyMap& client_properties) { - mus::View* frame_view = root_->view()->GetChildById(frame_id); + mojo::View* frame_view = root_->view()->GetChildById(frame_id); // |frame_view| may be null if the View hasn't been created yet. If this is // the case the View will be connected to the Frame in Frame::OnTreeChanged. Frame* frame = diff --git a/components/web_view/frame_tree.h b/components/web_view/frame_tree.h index 64595c8..ad457d9 100644 --- a/components/web_view/frame_tree.h +++ b/components/web_view/frame_tree.h @@ -32,7 +32,7 @@ class FrameTree { // |root_app_id| is a unique identifier of the app providing |root_client|. // See Frame for details on app id's. FrameTree(uint32_t root_app_id, - mus::View* view, + mojo::View* view, mojo::ViewTreeClientPtr view_tree_client, FrameTreeDelegate* delegate, FrameTreeClient* root_client, @@ -66,7 +66,7 @@ class FrameTree { const mojo::String& name, const mojo::Array<uint8_t>& value); - mus::View* view_; + mojo::View* view_; FrameTreeDelegate* delegate_; diff --git a/components/web_view/frame_tree_delegate.h b/components/web_view/frame_tree_delegate.h index 4b8afd7..123679f 100644 --- a/components/web_view/frame_tree_delegate.h +++ b/components/web_view/frame_tree_delegate.h @@ -51,7 +51,7 @@ class FrameTreeDelegate { // Asks the client if navigation is allowed. If the navigation is allowed // |callback| should be called to continue the navigation. |callback| // may be called synchronously or asynchronously. In the callback - // mojo::ViewTreeClientPtr should only be set if an app other than + // ViewTreeClientPtr should only be set if an app other than // frame->app_id() is used to render |request|. virtual void CanNavigateFrame(Frame* target, mojo::URLRequestPtr request, diff --git a/components/web_view/public/cpp/web_view.cc b/components/web_view/public/cpp/web_view.cc index d2ae310..5db2379 100644 --- a/components/web_view/public/cpp/web_view.cc +++ b/components/web_view/public/cpp/web_view.cc @@ -20,7 +20,7 @@ void OnEmbed(bool success, uint16 connection_id) { WebView::WebView(mojom::WebViewClient* client) : binding_(client) {} WebView::~WebView() {} -void WebView::Init(mojo::ApplicationImpl* app, mus::View* view) { +void WebView::Init(mojo::ApplicationImpl* app, mojo::View* view) { mojo::URLRequestPtr request(mojo::URLRequest::New()); request->url = "mojo:web_view"; diff --git a/components/web_view/public/cpp/web_view.h b/components/web_view/public/cpp/web_view.h index b10c0d3..d3abc5a 100644 --- a/components/web_view/public/cpp/web_view.h +++ b/components/web_view/public/cpp/web_view.h @@ -12,9 +12,6 @@ namespace mojo { class ApplicationImpl; -} - -namespace mus { class View; } @@ -25,7 +22,7 @@ class WebView { explicit WebView(mojom::WebViewClient* client); ~WebView(); - void Init(mojo::ApplicationImpl* app, mus::View* view); + void Init(mojo::ApplicationImpl* app, mojo::View* view); mojom::WebView* web_view() { return web_view_.get(); } diff --git a/components/web_view/test_runner/test_runner_application_delegate.cc b/components/web_view/test_runner/test_runner_application_delegate.cc index 7a39632..6442077 100644 --- a/components/web_view/test_runner/test_runner_application_delegate.cc +++ b/components/web_view/test_runner/test_runner_application_delegate.cc @@ -39,7 +39,7 @@ TestRunnerApplicationDelegate::TestRunnerApplicationDelegate() TestRunnerApplicationDelegate::~TestRunnerApplicationDelegate() { if (root_) - mus::ScopedViewPtr::DeleteViewOrViewManager(root_); + mojo::ScopedViewPtr::DeleteViewOrViewManager(root_); } void TestRunnerApplicationDelegate::LaunchURL(const GURL& test_url) { @@ -54,7 +54,7 @@ void TestRunnerApplicationDelegate::LaunchURL(const GURL& test_url) { void TestRunnerApplicationDelegate::Terminate() { if (root_) - mus::ScopedViewPtr::DeleteViewOrViewManager(root_); + mojo::ScopedViewPtr::DeleteViewOrViewManager(root_); } //////////////////////////////////////////////////////////////////////////////// @@ -62,7 +62,7 @@ void TestRunnerApplicationDelegate::Terminate() { void TestRunnerApplicationDelegate::Initialize(mojo::ApplicationImpl* app) { app_ = app; - mus::CreateSingleViewTreeHost(app_, this, &host_); + mojo::CreateSingleViewTreeHost(app_, this, &host_); } bool TestRunnerApplicationDelegate::ConfigureIncomingConnection( @@ -72,9 +72,9 @@ bool TestRunnerApplicationDelegate::ConfigureIncomingConnection( } //////////////////////////////////////////////////////////////////////////////// -// mus::ViewTreeDelegate implementation: +// mojo::ViewTreeDelegate implementation: -void TestRunnerApplicationDelegate::OnEmbed(mus::View* root) { +void TestRunnerApplicationDelegate::OnEmbed(mojo::View* root) { root_ = root; // If this is a sys-check, then terminate in the next cycle. @@ -107,7 +107,7 @@ void TestRunnerApplicationDelegate::OnEmbed(mus::View* root) { } void TestRunnerApplicationDelegate::OnConnectionLost( - mus::ViewTreeConnection* connection) { + mojo::ViewTreeConnection* connection) { root_ = nullptr; app_->Quit(); } diff --git a/components/web_view/test_runner/test_runner_application_delegate.h b/components/web_view/test_runner/test_runner_application_delegate.h index 6addcae..0e283be 100644 --- a/components/web_view/test_runner/test_runner_application_delegate.h +++ b/components/web_view/test_runner/test_runner_application_delegate.h @@ -27,7 +27,7 @@ namespace web_view { class TestRunnerApplicationDelegate : public mojo::ApplicationDelegate, - public mus::ViewTreeDelegate, + public mojo::ViewTreeDelegate, public mojom::WebViewClient, public LayoutTestRunner, public mojo::InterfaceFactory<LayoutTestRunner> { @@ -44,9 +44,9 @@ class TestRunnerApplicationDelegate bool ConfigureIncomingConnection( mojo::ApplicationConnection* connection) override; - // mus::ViewTreeDelegate: - void OnEmbed(mus::View* root) override; - void OnConnectionLost(mus::ViewTreeConnection* connection) override; + // mojo::ViewTreeDelegate: + void OnEmbed(mojo::View* root) override; + void OnConnectionLost(mojo::ViewTreeConnection* connection) override; // mojom::WebViewClient: void TopLevelNavigate(mojo::URLRequestPtr request) override; @@ -66,8 +66,8 @@ class TestRunnerApplicationDelegate mojo::ApplicationImpl* app_; mojo::ViewTreeHostPtr host_; - mus::View* root_; - mus::View* content_; + mojo::View* root_; + mojo::View* content_; scoped_ptr<WebView> web_view_; scoped_ptr<test_runner::TestInfoExtractor> test_extractor_; diff --git a/components/web_view/web_view_apptest.cc b/components/web_view/web_view_apptest.cc index 400f6ff..440d80c 100644 --- a/components/web_view/web_view_apptest.cc +++ b/components/web_view/web_view_apptest.cc @@ -28,7 +28,7 @@ const char kTestThreeFile[] = "test_three.html"; const char kTestThreeTitle[] = "Test Title Three"; } -class WebViewTest : public mus::ViewManagerTestBase, +class WebViewTest : public mojo::ViewManagerTestBase, public mojom::WebViewClient { public: WebViewTest() : web_view_(this) {} @@ -75,7 +75,7 @@ class WebViewTest : public mus::ViewManagerTestBase, } // Overridden from ViewTreeDelegate: - void OnEmbed(mus::View* root) override { + void OnEmbed(mojo::View* root) override { content_ = root->connection()->CreateView(); root->AddChild(content_); content_->SetVisible(true); @@ -86,7 +86,7 @@ class WebViewTest : public mus::ViewManagerTestBase, } void TearDown() override { - mus::ScopedViewPtr::DeleteViewOrViewManager(window_manager()->GetRoot()); + mojo::ScopedViewPtr::DeleteViewOrViewManager(window_manager()->GetRoot()); ViewManagerTestBase::TearDown(); } @@ -108,7 +108,7 @@ class WebViewTest : public mus::ViewManagerTestBase, mojo::ApplicationImpl* app_; - mus::View* content_; + mojo::View* content_; web_view::WebView web_view_; diff --git a/components/web_view/web_view_impl.cc b/components/web_view/web_view_impl.cc index 908fe7c..21eeabe 100644 --- a/components/web_view/web_view_impl.cc +++ b/components/web_view/web_view_impl.cc @@ -51,7 +51,7 @@ WebViewImpl::~WebViewImpl() { content_->RemoveObserver(this); if (root_) { root_->RemoveObserver(this); - mus::ScopedViewPtr::DeleteViewOrViewManager(root_); + mojo::ScopedViewPtr::DeleteViewOrViewManager(root_); } } @@ -109,7 +109,7 @@ void WebViewImpl::LoadRequest(mojo::URLRequestPtr request) { void WebViewImpl::GetViewTreeClient( mojo::InterfaceRequest<mojo::ViewTreeClient> view_tree_client) { - mus::ViewTreeConnection::Create(this, view_tree_client.Pass()); + mojo::ViewTreeConnection::Create(this, view_tree_client.Pass()); } void WebViewImpl::GoBack() { @@ -138,9 +138,9 @@ void WebViewImpl::GoForward() { } //////////////////////////////////////////////////////////////////////////////// -// WebViewImpl, mus::ViewTreeDelegate implementation: +// WebViewImpl, mojo::ViewTreeDelegate implementation: -void WebViewImpl::OnEmbed(mus::View* root) { +void WebViewImpl::OnEmbed(mojo::View* root) { // We must have been granted embed root priviledges, otherwise we can't // Embed() in any descendants. DCHECK(root->connection()->IsEmbedRoot()); @@ -157,14 +157,14 @@ void WebViewImpl::OnEmbed(mus::View* root) { OnLoad(); } -void WebViewImpl::OnConnectionLost(mus::ViewTreeConnection* connection) { +void WebViewImpl::OnConnectionLost(mojo::ViewTreeConnection* connection) { root_ = nullptr; } //////////////////////////////////////////////////////////////////////////////// -// WebViewImpl, mus::ViewObserver implementation: +// WebViewImpl, mojo::ViewObserver implementation: -void WebViewImpl::OnViewBoundsChanged(mus::View* view, +void WebViewImpl::OnViewBoundsChanged(mojo::View* view, const mojo::Rect& old_bounds, const mojo::Rect& new_bounds) { if (view != content_) { @@ -175,7 +175,7 @@ void WebViewImpl::OnViewBoundsChanged(mus::View* view, } } -void WebViewImpl::OnViewDestroyed(mus::View* view) { +void WebViewImpl::OnViewDestroyed(mojo::View* view) { // |FrameTree| cannot outlive the content view. if (view == content_) { frame_tree_.reset(); diff --git a/components/web_view/web_view_impl.h b/components/web_view/web_view_impl.h index fdde32a..b706f94 100644 --- a/components/web_view/web_view_impl.h +++ b/components/web_view/web_view_impl.h @@ -29,8 +29,8 @@ class PendingWebViewLoad; class URLRequestCloneable; class WebViewImpl : public mojom::WebView, - public mus::ViewTreeDelegate, - public mus::ViewObserver, + public mojo::ViewTreeDelegate, + public mojo::ViewObserver, public FrameTreeDelegate, public FrameDevToolsAgentDelegate { public: @@ -58,15 +58,15 @@ class WebViewImpl : public mojom::WebView, void GoBack() override; void GoForward() override; - // Overridden from mus::ViewTreeDelegate: - void OnEmbed(mus::View* root) override; - void OnConnectionLost(mus::ViewTreeConnection* connection) override; + // Overridden from mojo::ViewTreeDelegate: + void OnEmbed(mojo::View* root) override; + void OnConnectionLost(mojo::ViewTreeConnection* connection) override; - // Overridden from mus::ViewObserver: - void OnViewBoundsChanged(mus::View* view, + // Overridden from mojo::ViewObserver: + void OnViewBoundsChanged(mojo::View* view, const mojo::Rect& old_bounds, const mojo::Rect& new_bounds) override; - void OnViewDestroyed(mus::View* view) override; + void OnViewDestroyed(mojo::View* view) override; // Overridden from FrameTreeDelegate: bool CanPostMessageEventToFrame(const Frame* source, @@ -87,8 +87,8 @@ class WebViewImpl : public mojom::WebView, mojo::ApplicationImpl* app_; mojom::WebViewClientPtr client_; mojo::StrongBinding<WebView> binding_; - mus::View* root_; - mus::View* content_; + mojo::View* root_; + mojo::View* content_; scoped_ptr<FrameTree> frame_tree_; // When LoadRequest() is called a PendingWebViewLoad is created to wait for |