OLD | NEW |
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/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 // WebContentsImpl::DestructionObserver ---------------------------------------- | 282 // WebContentsImpl::DestructionObserver ---------------------------------------- |
283 | 283 |
284 class WebContentsImpl::DestructionObserver : public WebContentsObserver { | 284 class WebContentsImpl::DestructionObserver : public WebContentsObserver { |
285 public: | 285 public: |
286 DestructionObserver(WebContentsImpl* owner, WebContents* watched_contents) | 286 DestructionObserver(WebContentsImpl* owner, WebContents* watched_contents) |
287 : WebContentsObserver(watched_contents), | 287 : WebContentsObserver(watched_contents), |
288 owner_(owner) { | 288 owner_(owner) { |
289 } | 289 } |
290 | 290 |
291 // WebContentsObserver: | 291 // WebContentsObserver: |
292 virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE { | 292 virtual void WebContentsDestroyed() OVERRIDE { |
293 owner_->OnWebContentsDestroyed(static_cast<WebContentsImpl*>(web_contents)); | 293 owner_->OnWebContentsDestroyed( |
| 294 static_cast<WebContentsImpl*>(web_contents())); |
294 } | 295 } |
295 | 296 |
296 private: | 297 private: |
297 WebContentsImpl* owner_; | 298 WebContentsImpl* owner_; |
298 | 299 |
299 DISALLOW_COPY_AND_ASSIGN(DestructionObserver); | 300 DISALLOW_COPY_AND_ASSIGN(DestructionObserver); |
300 }; | 301 }; |
301 | 302 |
302 WebContentsImpl::ColorChooserInfo::ColorChooserInfo(int render_process_id, | 303 WebContentsImpl::ColorChooserInfo::ColorChooserInfo(int render_process_id, |
303 int render_frame_id, | 304 int render_frame_id, |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 } | 413 } |
413 | 414 |
414 ForEachFrame(run_render_frame_deleted_callback); | 415 ForEachFrame(run_render_frame_deleted_callback); |
415 | 416 |
416 FOR_EACH_OBSERVER(WebContentsObserver, | 417 FOR_EACH_OBSERVER(WebContentsObserver, |
417 observers_, | 418 observers_, |
418 RenderViewDeleted(GetRenderManager()->current_host())); | 419 RenderViewDeleted(GetRenderManager()->current_host())); |
419 | 420 |
420 FOR_EACH_OBSERVER(WebContentsObserver, | 421 FOR_EACH_OBSERVER(WebContentsObserver, |
421 observers_, | 422 observers_, |
422 WebContentsImplDestroyed()); | 423 WebContentsDestroyed()); |
| 424 |
| 425 FOR_EACH_OBSERVER(WebContentsObserver, |
| 426 observers_, |
| 427 WebContentsDestroyedPrivate()); |
423 | 428 |
424 SetDelegate(NULL); | 429 SetDelegate(NULL); |
425 | 430 |
426 STLDeleteContainerPairSecondPointers(destruction_observers_.begin(), | 431 STLDeleteContainerPairSecondPointers(destruction_observers_.begin(), |
427 destruction_observers_.end()); | 432 destruction_observers_.end()); |
428 } | 433 } |
429 | 434 |
430 WebContentsImpl* WebContentsImpl::CreateWithOpener( | 435 WebContentsImpl* WebContentsImpl::CreateWithOpener( |
431 const WebContents::CreateParams& params, | 436 const WebContents::CreateParams& params, |
432 WebContentsImpl* opener) { | 437 WebContentsImpl* opener) { |
(...skipping 3491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3924 | 3929 |
3925 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { | 3930 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { |
3926 if (!delegate_) | 3931 if (!delegate_) |
3927 return; | 3932 return; |
3928 const gfx::Size new_size = GetPreferredSize(); | 3933 const gfx::Size new_size = GetPreferredSize(); |
3929 if (new_size != old_size) | 3934 if (new_size != old_size) |
3930 delegate_->UpdatePreferredSize(this, new_size); | 3935 delegate_->UpdatePreferredSize(this, new_size); |
3931 } | 3936 } |
3932 | 3937 |
3933 } // namespace content | 3938 } // namespace content |
OLD | NEW |