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

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

Issue 6735042: Move favicon from TabContents to TabContentsWrapper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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) {
29 } 31 }
30 32
31 void TabContentsObserver::DidNavigateMainFramePostCommit( 33 void TabContentsObserver::DidNavigateMainFramePostCommit(
32 const NavigationController::LoadCommittedDetails& details, 34 const NavigationController::LoadCommittedDetails& details,
33 const ViewHostMsg_FrameNavigate_Params& params) { 35 const ViewHostMsg_FrameNavigate_Params& params) {
34 } 36 }
35 37
36 void TabContentsObserver::DidNavigateAnyFramePostCommit( 38 void TabContentsObserver::DidNavigateAnyFramePostCommit(
37 const NavigationController::LoadCommittedDetails& details, 39 const NavigationController::LoadCommittedDetails& details,
38 const ViewHostMsg_FrameNavigate_Params& params) { 40 const ViewHostMsg_FrameNavigate_Params& params) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 92 }
91 93
92 void TabContentsObserver::TabContentsDestroyed() { 94 void TabContentsObserver::TabContentsDestroyed() {
93 // Do cleanup so that 'this' can safely be deleted from 95 // Do cleanup so that 'this' can safely be deleted from
94 // OnTabContentsDestroyed. 96 // OnTabContentsDestroyed.
95 tab_contents_->RemoveObserver(this); 97 tab_contents_->RemoveObserver(this);
96 TabContents* tab = tab_contents_; 98 TabContents* tab = tab_contents_;
97 tab_contents_ = NULL; 99 tab_contents_ = NULL;
98 OnTabContentsDestroyed(tab); 100 OnTabContentsDestroyed(tab);
99 } 101 }
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