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

Side by Side Diff: components/plugins/renderer/webview_plugin.cc

Issue 1203693003: Setting Accurate ScrollResult from Blink for Elastic Scroll. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed piman review comments Created 5 years, 5 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/plugins/renderer/webview_plugin.h" 5 #include "components/plugins/renderer/webview_plugin.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/numerics/safe_conversions.h" 9 #include "base/numerics/safe_conversions.h"
10 #include "content/public/common/web_preferences.h" 10 #include "content/public/common/web_preferences.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 using blink::WebView; 43 using blink::WebView;
44 using content::WebPreferences; 44 using content::WebPreferences;
45 45
46 WebViewPlugin::WebViewPlugin(WebViewPlugin::Delegate* delegate, 46 WebViewPlugin::WebViewPlugin(WebViewPlugin::Delegate* delegate,
47 const WebPreferences& preferences) 47 const WebPreferences& preferences)
48 : delegate_(delegate), 48 : delegate_(delegate),
49 container_(NULL), 49 container_(NULL),
50 web_view_(WebView::create(this)), 50 web_view_(WebView::create(this)),
51 finished_loading_(false), 51 finished_loading_(false),
52 focused_(false) { 52 focused_(false) {
53 // ApplyWebPreferences before making a WebLocalFrame so that the frame sees a 53 // ApplyWebPreferencesInternal before making a WebLocalFrame so that the frame
54 // consistent view of our preferences. 54 // sees a consistent view of our preferences.
55 content::RenderView::ApplyWebPreferences(preferences, web_view_); 55 content::RenderView::ApplyWebPreferencesInternal(preferences, web_view_,
56 NULL);
56 web_frame_ = WebLocalFrame::create(blink::WebTreeScopeType::Document, this); 57 web_frame_ = WebLocalFrame::create(blink::WebTreeScopeType::Document, this);
57 web_view_->setMainFrame(web_frame_); 58 web_view_->setMainFrame(web_frame_);
58 } 59 }
59 60
60 // static 61 // static
61 WebViewPlugin* WebViewPlugin::Create(WebViewPlugin::Delegate* delegate, 62 WebViewPlugin* WebViewPlugin::Create(WebViewPlugin::Delegate* delegate,
62 const WebPreferences& preferences, 63 const WebPreferences& preferences,
63 const std::string& html_data, 64 const std::string& html_data,
64 const GURL& url) { 65 const GURL& url) {
65 DCHECK(url.is_valid()) << "Blink requires the WebView to have a valid URL."; 66 DCHECK(url.is_valid()) << "Blink requires the WebView to have a valid URL.";
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 280
280 global->Set(gin::StringToV8(isolate, "plugin"), 281 global->Set(gin::StringToV8(isolate, "plugin"),
281 delegate_->GetV8Handle(isolate)); 282 delegate_->GetV8Handle(isolate));
282 } 283 }
283 284
284 void WebViewPlugin::didReceiveResponse(WebLocalFrame* frame, 285 void WebViewPlugin::didReceiveResponse(WebLocalFrame* frame,
285 unsigned identifier, 286 unsigned identifier,
286 const WebURLResponse& response) { 287 const WebURLResponse& response) {
287 WebFrameClient::didReceiveResponse(frame, identifier, response); 288 WebFrameClient::didReceiveResponse(frame, identifier, response);
288 } 289 }
OLDNEW
« no previous file with comments | « no previous file | components/printing/renderer/print_web_view_helper.cc » ('j') | content/public/renderer/render_view.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698