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/html_viewer/html_frame_tree_manager.h" | 5 #include "components/html_viewer/html_frame_tree_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "components/html_viewer/blink_basic_type_converters.h" | 11 #include "components/html_viewer/blink_basic_type_converters.h" |
12 #include "components/html_viewer/blink_url_request_type_converters.h" | 12 #include "components/html_viewer/blink_url_request_type_converters.h" |
13 #include "components/html_viewer/document_resource_waiter.h" | 13 #include "components/html_viewer/document_resource_waiter.h" |
14 #include "components/html_viewer/global_state.h" | 14 #include "components/html_viewer/global_state.h" |
15 #include "components/html_viewer/html_frame.h" | 15 #include "components/html_viewer/html_frame.h" |
16 #include "components/html_viewer/html_frame_delegate.h" | 16 #include "components/html_viewer/html_frame_delegate.h" |
17 #include "components/html_viewer/html_viewer_switches.h" | 17 #include "components/html_viewer/html_viewer_switches.h" |
18 #include "components/view_manager/public/cpp/view_manager.h" | 18 #include "components/view_manager/public/cpp/view_manager.h" |
19 #include "mojo/application/public/cpp/application_impl.h" | |
20 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 19 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
21 #include "third_party/WebKit/public/web/WebRemoteFrame.h" | 20 #include "third_party/WebKit/public/web/WebRemoteFrame.h" |
22 #include "third_party/WebKit/public/web/WebTreeScopeType.h" | 21 #include "third_party/WebKit/public/web/WebTreeScopeType.h" |
23 #include "third_party/WebKit/public/web/WebView.h" | 22 #include "third_party/WebKit/public/web/WebView.h" |
24 #include "ui/gfx/geometry/dip_util.h" | 23 #include "ui/gfx/geometry/dip_util.h" |
25 #include "ui/gfx/geometry/size.h" | 24 #include "ui/gfx/geometry/size.h" |
26 | 25 |
27 namespace html_viewer { | 26 namespace html_viewer { |
28 namespace { | 27 namespace { |
29 | 28 |
(...skipping 12 matching lines...) Expand all Loading... |
42 } | 41 } |
43 | 42 |
44 } // namespace | 43 } // namespace |
45 | 44 |
46 // static | 45 // static |
47 HTMLFrameTreeManager::TreeMap* HTMLFrameTreeManager::instances_ = nullptr; | 46 HTMLFrameTreeManager::TreeMap* HTMLFrameTreeManager::instances_ = nullptr; |
48 | 47 |
49 // static | 48 // static |
50 HTMLFrame* HTMLFrameTreeManager::CreateFrameAndAttachToTree( | 49 HTMLFrame* HTMLFrameTreeManager::CreateFrameAndAttachToTree( |
51 GlobalState* global_state, | 50 GlobalState* global_state, |
52 mojo::ApplicationImpl* app, | |
53 mojo::View* view, | 51 mojo::View* view, |
54 scoped_ptr<DocumentResourceWaiter> resource_waiter, | 52 scoped_ptr<DocumentResourceWaiter> resource_waiter, |
55 HTMLFrameDelegate* delegate) { | 53 HTMLFrameDelegate* delegate) { |
56 if (!instances_) | 54 if (!instances_) |
57 instances_ = new TreeMap; | 55 instances_ = new TreeMap; |
58 | 56 |
59 mojo::InterfaceRequest<mandoline::FrameTreeClient> frame_tree_client_request; | 57 mojo::InterfaceRequest<mandoline::FrameTreeClient> frame_tree_client_request; |
60 mandoline::FrameTreeServerPtr frame_tree_server; | 58 mandoline::FrameTreeServerPtr frame_tree_server; |
61 mojo::Array<mandoline::FrameDataPtr> frame_data; | 59 mojo::Array<mandoline::FrameDataPtr> frame_data; |
62 uint32_t change_id; | 60 uint32_t change_id; |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 mojo::Array<uint8_t> new_data) { | 278 mojo::Array<uint8_t> new_data) { |
281 if (source != local_root_) | 279 if (source != local_root_) |
282 return; | 280 return; |
283 | 281 |
284 HTMLFrame* frame = root_->FindFrame(frame_id); | 282 HTMLFrame* frame = root_->FindFrame(frame_id); |
285 if (frame) | 283 if (frame) |
286 frame->SetValueFromClientProperty(name, new_data.Pass()); | 284 frame->SetValueFromClientProperty(name, new_data.Pass()); |
287 } | 285 } |
288 | 286 |
289 } // namespace mojo | 287 } // namespace mojo |
OLD | NEW |