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

Side by Side Diff: content/test/test_web_contents.cc

Issue 14651029: content: Remove usage of NOTIFICATION_WEB_CONTENTS_DESTROYED from content (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix typo, rebase Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « content/shell/shell.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/test/test_web_contents.h" 5 #include "content/test/test_web_contents.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "content/browser/browser_url_handler_impl.h" 9 #include "content/browser/browser_url_handler_impl.h"
10 #include "content/browser/renderer_host/render_view_host_impl.h" 10 #include "content/browser/renderer_host/render_view_host_impl.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 RenderViewHostDelegateView* TestWebContents::GetDelegateView() { 163 RenderViewHostDelegateView* TestWebContents::GetDelegateView() {
164 if (delegate_view_override_) 164 if (delegate_view_override_)
165 return delegate_view_override_; 165 return delegate_view_override_;
166 return WebContentsImpl::GetDelegateView(); 166 return WebContentsImpl::GetDelegateView();
167 } 167 }
168 168
169 void TestWebContents::SetOpener(TestWebContents* opener) { 169 void TestWebContents::SetOpener(TestWebContents* opener) {
170 // This is normally only set in the WebContents constructor, which also 170 // This is normally only set in the WebContents constructor, which also
171 // registers an observer for when the opener gets closed. 171 // registers an observer for when the opener gets closed.
172 opener_ = opener; 172 opener_ = opener;
173 registrar_.Add(this, NOTIFICATION_WEB_CONTENTS_DESTROYED, 173 AddDestructionObserver(opener_);
174 Source<WebContents>(opener_));
175 } 174 }
176 175
177 void TestWebContents::AddPendingContents(TestWebContents* contents) { 176 void TestWebContents::AddPendingContents(TestWebContents* contents) {
178 // This is normally only done in WebContentsImpl::CreateNewWindow. 177 // This is normally only done in WebContentsImpl::CreateNewWindow.
179 pending_contents_[contents->GetRenderViewHost()->GetRoutingID()] = contents; 178 pending_contents_[contents->GetRenderViewHost()->GetRoutingID()] = contents;
180 registrar_.Add(this, NOTIFICATION_WEB_CONTENTS_DESTROYED, 179 AddDestructionObserver(contents);
181 Source<WebContents>(contents));
182 } 180 }
183 181
184 void TestWebContents::ExpectSetHistoryLengthAndPrune( 182 void TestWebContents::ExpectSetHistoryLengthAndPrune(
185 const SiteInstance* site_instance, 183 const SiteInstance* site_instance,
186 int history_length, 184 int history_length,
187 int32 min_page_id) { 185 int32 min_page_id) {
188 expect_set_history_length_and_prune_ = true; 186 expect_set_history_length_and_prune_ = true;
189 expect_set_history_length_and_prune_site_instance_ = 187 expect_set_history_length_and_prune_site_instance_ =
190 static_cast<const SiteInstanceImpl*>(site_instance); 188 static_cast<const SiteInstanceImpl*>(site_instance);
191 expect_set_history_length_and_prune_history_length_ = history_length; 189 expect_set_history_length_and_prune_history_length_ = history_length;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 } 239 }
242 240
243 void TestWebContents::ShowCreatedWidget(int route_id, 241 void TestWebContents::ShowCreatedWidget(int route_id,
244 const gfx::Rect& initial_pos) { 242 const gfx::Rect& initial_pos) {
245 } 243 }
246 244
247 void TestWebContents::ShowCreatedFullscreenWidget(int route_id) { 245 void TestWebContents::ShowCreatedFullscreenWidget(int route_id) {
248 } 246 }
249 247
250 } // namespace content 248 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/shell.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698