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

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

Issue 670173002: Fix webrequest api for webview in webui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scoped_refptr not testable Created 6 years, 1 month 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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 web_view_guest_delegate_->OnAttachWebViewHelpers(contents); 342 web_view_guest_delegate_->OnAttachWebViewHelpers(contents);
343 web_view_permission_helper_.reset(new WebViewPermissionHelper(this)); 343 web_view_permission_helper_.reset(new WebViewPermissionHelper(this));
344 } 344 }
345 345
346 void WebViewGuest::DidStopLoading() { 346 void WebViewGuest::DidStopLoading() {
347 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); 347 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue());
348 DispatchEventToEmbedder( 348 DispatchEventToEmbedder(
349 new GuestViewBase::Event(webview::kEventLoadStop, args.Pass())); 349 new GuestViewBase::Event(webview::kEventLoadStop, args.Pass()));
350 } 350 }
351 351
352 void WebViewGuest::EmbedderDestroyed() { 352 void WebViewGuest::EmbedderWillBeDestroyed() {
353 if (web_view_guest_delegate_)
354 web_view_guest_delegate_->OnEmbedderWillBeDestroyed();
355
353 content::BrowserThread::PostTask( 356 content::BrowserThread::PostTask(
354 content::BrowserThread::IO, 357 content::BrowserThread::IO,
355 FROM_HERE, 358 FROM_HERE,
356 base::Bind( 359 base::Bind(
357 &RemoveWebViewEventListenersOnIOThread, 360 &RemoveWebViewEventListenersOnIOThread,
358 browser_context(), 361 browser_context(),
359 embedder_extension_id(), 362 embedder_extension_id(),
360 embedder_render_process_id(), 363 embedder_render_process_id(),
361 view_instance_id())); 364 view_instance_id()));
362 } 365 }
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after
1225 WebViewGuest* guest = 1228 WebViewGuest* guest =
1226 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); 1229 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id);
1227 if (!guest) 1230 if (!guest)
1228 return; 1231 return;
1229 1232
1230 if (!allow) 1233 if (!allow)
1231 guest->Destroy(); 1234 guest->Destroy();
1232 } 1235 }
1233 1236
1234 } // namespace extensions 1237 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698