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/web_view_impl.h" | 5 #include "components/web_view/web_view_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "components/devtools_service/public/cpp/switches.h" | 8 #include "components/devtools_service/public/cpp/switches.h" |
9 #include "components/view_manager/public/cpp/scoped_view_ptr.h" | 9 #include "components/view_manager/public/cpp/scoped_view_ptr.h" |
10 #include "components/view_manager/public/cpp/view.h" | 10 #include "components/view_manager/public/cpp/view.h" |
(...skipping 26 matching lines...) Expand all Loading... | |
37 : app_(app), | 37 : app_(app), |
38 client_(client.Pass()), | 38 client_(client.Pass()), |
39 binding_(this, request.Pass()), | 39 binding_(this, request.Pass()), |
40 root_(nullptr), | 40 root_(nullptr), |
41 content_(nullptr) { | 41 content_(nullptr) { |
42 if (EnableRemoteDebugging()) | 42 if (EnableRemoteDebugging()) |
43 devtools_agent_.reset(new FrameDevToolsAgent(app_, this)); | 43 devtools_agent_.reset(new FrameDevToolsAgent(app_, this)); |
44 } | 44 } |
45 | 45 |
46 WebViewImpl::~WebViewImpl() { | 46 WebViewImpl::~WebViewImpl() { |
47 pending_load_.reset(); | |
sky
2015/09/10 22:09:30
Document why you need to do this.
Elliot Glaysher
2015/09/10 22:32:35
Turned out to not need this...after the changes to
| |
47 if (content_) | 48 if (content_) |
48 content_->RemoveObserver(this); | 49 content_->RemoveObserver(this); |
49 if (root_) { | 50 if (root_) { |
50 root_->RemoveObserver(this); | 51 root_->RemoveObserver(this); |
51 mojo::ScopedViewPtr::DeleteViewOrViewManager(root_); | 52 mojo::ScopedViewPtr::DeleteViewOrViewManager(root_); |
52 } | 53 } |
53 } | 54 } |
54 | 55 |
55 void WebViewImpl::OnLoad() { | 56 void WebViewImpl::OnLoad() { |
56 scoped_ptr<PendingWebViewLoad> pending_load(pending_load_.Pass()); | 57 scoped_ptr<PendingWebViewLoad> pending_load(pending_load_.Pass()); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
170 //////////////////////////////////////////////////////////////////////////////// | 171 //////////////////////////////////////////////////////////////////////////////// |
171 // WebViewImpl, FrameDevToolsAgentDelegate implementation: | 172 // WebViewImpl, FrameDevToolsAgentDelegate implementation: |
172 | 173 |
173 void WebViewImpl::HandlePageNavigateRequest(const GURL& url) { | 174 void WebViewImpl::HandlePageNavigateRequest(const GURL& url) { |
174 mojo::URLRequestPtr request(mojo::URLRequest::New()); | 175 mojo::URLRequestPtr request(mojo::URLRequest::New()); |
175 request->url = url.spec(); | 176 request->url = url.spec(); |
176 client_->TopLevelNavigate(request.Pass()); | 177 client_->TopLevelNavigate(request.Pass()); |
177 } | 178 } |
178 | 179 |
179 } // namespace web_view | 180 } // namespace web_view |
OLD | NEW |