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

Side by Side Diff: extensions/browser/guest_view/guest_view_base.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/guest_view_base.h" 5 #include "extensions/browser/guest_view/guest_view_base.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "content/public/browser/render_frame_host.h" 9 #include "content/public/browser/render_frame_host.h"
10 #include "content/public/browser/render_process_host.h" 10 #include "content/public/browser/render_process_host.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 Destroy(); 84 Destroy();
85 } 85 }
86 86
87 private: 87 private:
88 bool destroyed_; 88 bool destroyed_;
89 GuestViewBase* guest_; 89 GuestViewBase* guest_;
90 90
91 void Destroy() { 91 void Destroy() {
92 if (destroyed_) 92 if (destroyed_)
93 return; 93 return;
94
94 destroyed_ = true; 95 destroyed_ = true;
96 guest_->EmbedderWillBeDestroyed();
95 guest_->embedder_web_contents_ = NULL; 97 guest_->embedder_web_contents_ = NULL;
96 guest_->EmbedderDestroyed();
97 guest_->Destroy(); 98 guest_->Destroy();
98 } 99 }
99 100
100 DISALLOW_COPY_AND_ASSIGN(EmbedderLifetimeObserver); 101 DISALLOW_COPY_AND_ASSIGN(EmbedderLifetimeObserver);
101 }; 102 };
102 103
103 GuestViewBase::GuestViewBase(content::BrowserContext* browser_context, 104 GuestViewBase::GuestViewBase(content::BrowserContext* browser_context,
104 int guest_instance_id) 105 int guest_instance_id)
105 : embedder_web_contents_(NULL), 106 : embedder_web_contents_(NULL),
106 embedder_render_process_id_(0), 107 embedder_render_process_id_(0),
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 494
494 // static 495 // static
495 void GuestViewBase::RegisterGuestViewTypes() { 496 void GuestViewBase::RegisterGuestViewTypes() {
496 AppViewGuest::Register(); 497 AppViewGuest::Register();
497 ExtensionOptionsGuest::Register(); 498 ExtensionOptionsGuest::Register();
498 MimeHandlerViewGuest::Register(); 499 MimeHandlerViewGuest::Register();
499 WebViewGuest::Register(); 500 WebViewGuest::Register();
500 } 501 }
501 502
502 } // namespace extensions 503 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/guest_view/guest_view_base.h ('k') | extensions/browser/guest_view/web_view/web_view_guest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698