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

Side by Side Diff: content/browser/tab_contents/tab_contents_observer.cc

Issue 6814029: Revert 80519 - Move favicon from TabContents to TabContentsWrapper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 8 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/tab_contents/tab_contents_observer.h" 5 #include "content/browser/tab_contents/tab_contents_observer.h"
6 6
7 #include "content/browser/renderer_host/render_view_host.h" 7 #include "content/browser/renderer_host/render_view_host.h"
8 #include "content/browser/tab_contents/tab_contents.h" 8 #include "content/browser/tab_contents/tab_contents.h"
9 9
10 TabContentsObserver::Registrar::Registrar(TabContentsObserver* observer) 10 TabContentsObserver::Registrar::Registrar(TabContentsObserver* observer)
11 : observer_(observer), tab_(NULL) { 11 : observer_(observer), tab_(NULL) {
12 } 12 }
13 13
14 TabContentsObserver::Registrar::~Registrar() { 14 TabContentsObserver::Registrar::~Registrar() {
15 if (tab_) 15 if (tab_)
16 tab_->RemoveObserver(observer_); 16 tab_->RemoveObserver(observer_);
17 } 17 }
18 18
19 void TabContentsObserver::Registrar::Observe(TabContents* tab) { 19 void TabContentsObserver::Registrar::Observe(TabContents* tab) {
20 observer_->SetTabContents(tab); 20 observer_->SetTabContents(tab);
21 if (tab_) 21 if (tab_)
22 tab_->RemoveObserver(observer_); 22 tab_->RemoveObserver(observer_);
23 tab_ = tab; 23 tab_ = tab;
24 if (tab_) 24 if (tab_)
25 tab_->AddObserver(observer_); 25 tab_->AddObserver(observer_);
26 } 26 }
27 27
28 void TabContentsObserver::NavigateToPendingEntry( 28 void TabContentsObserver::NavigateToPendingEntry() {
29 const GURL& url,
30 NavigationController::ReloadType reload_type) {
31 } 29 }
32 30
33 void TabContentsObserver::DidNavigateMainFramePostCommit( 31 void TabContentsObserver::DidNavigateMainFramePostCommit(
34 const NavigationController::LoadCommittedDetails& details, 32 const NavigationController::LoadCommittedDetails& details,
35 const ViewHostMsg_FrameNavigate_Params& params) { 33 const ViewHostMsg_FrameNavigate_Params& params) {
36 } 34 }
37 35
38 void TabContentsObserver::DidNavigateAnyFramePostCommit( 36 void TabContentsObserver::DidNavigateAnyFramePostCommit(
39 const NavigationController::LoadCommittedDetails& details, 37 const NavigationController::LoadCommittedDetails& details,
40 const ViewHostMsg_FrameNavigate_Params& params) { 38 const ViewHostMsg_FrameNavigate_Params& params) {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 } 97 }
100 98
101 void TabContentsObserver::TabContentsDestroyed() { 99 void TabContentsObserver::TabContentsDestroyed() {
102 // Do cleanup so that 'this' can safely be deleted from 100 // Do cleanup so that 'this' can safely be deleted from
103 // OnTabContentsDestroyed. 101 // OnTabContentsDestroyed.
104 tab_contents_->RemoveObserver(this); 102 tab_contents_->RemoveObserver(this);
105 TabContents* tab = tab_contents_; 103 TabContents* tab = tab_contents_;
106 tab_contents_ = NULL; 104 tab_contents_ = NULL;
107 OnTabContentsDestroyed(tab); 105 OnTabContentsDestroyed(tab);
108 } 106 }
OLDNEW
« no previous file with comments | « content/browser/tab_contents/tab_contents_observer.h ('k') | content/browser/webui/web_ui_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698