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

Side by Side Diff: extensions/browser/guest_view/web_view/web_view_guest.cc

Issue 945333002: Implement <webview> droplink event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup_bpe
Patch Set: Created 5 years, 10 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/guest_view/web_view/web_view_guest.h" 5 #include "extensions/browser/guest_view/web_view/web_view_guest.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "content/public/browser/browser_context.h" 10 #include "content/public/browser/browser_context.h"
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 owner_render_process_host->GetBrowserContext(), 267 owner_render_process_host->GetBrowserContext(),
268 guest_site_instance); 268 guest_site_instance);
269 params.guest_delegate = this; 269 params.guest_delegate = this;
270 callback.Run(WebContents::Create(params)); 270 callback.Run(WebContents::Create(params));
271 } 271 }
272 272
273 void WebViewGuest::DidAttachToEmbedder() { 273 void WebViewGuest::DidAttachToEmbedder() {
274 ApplyAttributes(*attach_params()); 274 ApplyAttributes(*attach_params());
275 } 275 }
276 276
277 void WebViewGuest::DidDropLink(const GURL& url) {
278 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue());
279 args->SetString(guestview::kUrl, url.spec());
280 DispatchEventToView(
281 new GuestViewBase::Event(webview::kEventDropLink, args.Pass()));
282 }
283
277 void WebViewGuest::DidInitialize(const base::DictionaryValue& create_params) { 284 void WebViewGuest::DidInitialize(const base::DictionaryValue& create_params) {
278 script_executor_.reset( 285 script_executor_.reset(
279 new ScriptExecutor(web_contents(), &script_observers_)); 286 new ScriptExecutor(web_contents(), &script_observers_));
280 287
281 notification_registrar_.Add(this, 288 notification_registrar_.Add(this,
282 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, 289 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME,
283 content::Source<WebContents>(web_contents())); 290 content::Source<WebContents>(web_contents()));
284 291
285 notification_registrar_.Add(this, 292 notification_registrar_.Add(this,
286 content::NOTIFICATION_RESOURCE_RECEIVED_REDIRECT, 293 content::NOTIFICATION_RESOURCE_RECEIVED_REDIRECT,
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after
1262 WebViewGuest::From(owner_web_contents()->GetRenderProcessHost()->GetID(), 1269 WebViewGuest::From(owner_web_contents()->GetRenderProcessHost()->GetID(),
1263 new_window_instance_id); 1270 new_window_instance_id);
1264 if (!guest) 1271 if (!guest)
1265 return; 1272 return;
1266 1273
1267 if (!allow) 1274 if (!allow)
1268 guest->Destroy(); 1275 guest->Destroy();
1269 } 1276 }
1270 1277
1271 } // namespace extensions 1278 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698