OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/web_view/frame_tree.h" | 5 #include "components/web_view/frame_tree.h" |
6 | 6 |
7 #include "components/web_view/frame_tree_delegate.h" | 7 #include "components/web_view/frame_tree_delegate.h" |
8 #include "components/web_view/frame_user_data.h" | 8 #include "components/web_view/frame_user_data.h" |
9 | 9 |
10 namespace web_view { | 10 namespace web_view { |
11 | 11 |
12 FrameTree::FrameTree(uint32_t root_app_id, | 12 FrameTree::FrameTree(uint32_t root_app_id, |
13 mus::View* view, | 13 mojo::View* view, |
14 mojo::ViewTreeClientPtr view_tree_client, | 14 mojo::ViewTreeClientPtr view_tree_client, |
15 FrameTreeDelegate* delegate, | 15 FrameTreeDelegate* delegate, |
16 FrameTreeClient* root_client, | 16 FrameTreeClient* root_client, |
17 scoped_ptr<FrameUserData> user_data, | 17 scoped_ptr<FrameUserData> user_data, |
18 const Frame::ClientPropertyMap& client_properties) | 18 const Frame::ClientPropertyMap& client_properties) |
19 : view_(view), | 19 : view_(view), |
20 delegate_(delegate), | 20 delegate_(delegate), |
21 root_(new Frame(this, | 21 root_(new Frame(this, |
22 view, | 22 view, |
23 view->id(), | 23 view->id(), |
(...skipping 12 matching lines...) Expand all Loading... |
36 // as to see if it is the root). | 36 // as to see if it is the root). |
37 delete root_; | 37 delete root_; |
38 root_ = nullptr; | 38 root_ = nullptr; |
39 } | 39 } |
40 | 40 |
41 Frame* FrameTree::CreateSharedFrame( | 41 Frame* FrameTree::CreateSharedFrame( |
42 Frame* parent, | 42 Frame* parent, |
43 uint32_t frame_id, | 43 uint32_t frame_id, |
44 uint32_t app_id, | 44 uint32_t app_id, |
45 const Frame::ClientPropertyMap& client_properties) { | 45 const Frame::ClientPropertyMap& client_properties) { |
46 mus::View* frame_view = root_->view()->GetChildById(frame_id); | 46 mojo::View* frame_view = root_->view()->GetChildById(frame_id); |
47 // |frame_view| may be null if the View hasn't been created yet. If this is | 47 // |frame_view| may be null if the View hasn't been created yet. If this is |
48 // the case the View will be connected to the Frame in Frame::OnTreeChanged. | 48 // the case the View will be connected to the Frame in Frame::OnTreeChanged. |
49 Frame* frame = | 49 Frame* frame = |
50 new Frame(this, frame_view, frame_id, app_id, ViewOwnership::OWNS_VIEW, | 50 new Frame(this, frame_view, frame_id, app_id, ViewOwnership::OWNS_VIEW, |
51 nullptr, nullptr, client_properties); | 51 nullptr, nullptr, client_properties); |
52 frame->Init(parent, nullptr); | 52 frame->Init(parent, nullptr); |
53 return frame; | 53 return frame; |
54 } | 54 } |
55 | 55 |
56 uint32_t FrameTree::AdvanceChangeID() { | 56 uint32_t FrameTree::AdvanceChangeID() { |
(...skipping 21 matching lines...) Expand all Loading... |
78 delegate_->TitleChanged(title); | 78 delegate_->TitleChanged(title); |
79 } | 79 } |
80 | 80 |
81 void FrameTree::ClientPropertyChanged(const Frame* source, | 81 void FrameTree::ClientPropertyChanged(const Frame* source, |
82 const mojo::String& name, | 82 const mojo::String& name, |
83 const mojo::Array<uint8_t>& value) { | 83 const mojo::Array<uint8_t>& value) { |
84 root_->NotifyClientPropertyChanged(source, name, value); | 84 root_->NotifyClientPropertyChanged(source, name, value); |
85 } | 85 } |
86 | 86 |
87 } // namespace web_view | 87 } // namespace web_view |
OLD | NEW |