Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: components/web_view/web_view_impl.cc

Issue 1333963003: mandoline: Set up WebViewTest and add a basic test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix gn check. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698