1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/browser/tab_contents/tab_contents_observer.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/tab_contents/navigation_details.h"
#include "content/browser/tab_contents/tab_contents.h"
void TabContentsObserver::RenderViewCreated(RenderViewHost* render_view_host) {
}
void TabContentsObserver::NavigateToPendingEntry(
const GURL& url,
NavigationController::ReloadType reload_type) {
}
void TabContentsObserver::DidNavigateMainFramePostCommit(
const content::LoadCommittedDetails& details,
const ViewHostMsg_FrameNavigate_Params& params) {
}
void TabContentsObserver::DidNavigateAnyFramePostCommit(
const content::LoadCommittedDetails& details,
const ViewHostMsg_FrameNavigate_Params& params) {
}
void TabContentsObserver::DidStartProvisionalLoadForFrame(
int64 frame_id,
bool is_main_frame,
const GURL& validated_url,
bool is_error_page,
RenderViewHost* render_view_host) {
}
void TabContentsObserver::ProvisionalChangeToMainFrameUrl(
const GURL& url,
bool has_opener_set) {
}
void TabContentsObserver::DidCommitProvisionalLoadForFrame(
int64 frame_id,
bool is_main_frame,
const GURL& url,
PageTransition::Type transition_type) {
}
void TabContentsObserver::DidFailProvisionalLoad(int64 frame_id,
bool is_main_frame,
const GURL& validated_url,
int error_code) {
}
void TabContentsObserver::DocumentLoadedInFrame(int64 frame_id) {
}
void TabContentsObserver::DidFinishLoad(int64 frame_id) {
}
void TabContentsObserver::DidGetUserGesture() {
}
void TabContentsObserver::DidGetIgnoredUIEvent() {
}
void TabContentsObserver::DidBecomeSelected() {
}
void TabContentsObserver::DidStartLoading() {
}
void TabContentsObserver::DidStopLoading() {
}
void TabContentsObserver::RenderViewGone() {
}
void TabContentsObserver::StopNavigation() {
}
void TabContentsObserver::DidOpenURL(const GURL& url,
const GURL& referrer,
WindowOpenDisposition disposition,
PageTransition::Type transition) {
}
void TabContentsObserver::DidOpenRequestedURL(TabContents* new_contents,
const GURL& url,
const GURL& referrer,
WindowOpenDisposition disposition,
PageTransition::Type transition,
int64 source_frame_id) {
}
void TabContentsObserver::AppCacheAccessed(const GURL& manifest_url,
bool blocked_by_policy) {
}
TabContentsObserver::TabContentsObserver(TabContents* tab_contents)
: tab_contents_(NULL), routing_id_(MSG_ROUTING_NONE) {
Observe(tab_contents);
}
TabContentsObserver::TabContentsObserver()
: tab_contents_(NULL), routing_id_(MSG_ROUTING_NONE) {
}
TabContentsObserver::~TabContentsObserver() {
if (tab_contents_)
tab_contents_->RemoveObserver(this);
}
void TabContentsObserver::Observe(TabContents* tab_contents) {
if (tab_contents_)
tab_contents_->RemoveObserver(this);
tab_contents_ = tab_contents;
if (tab_contents_) {
routing_id_ = tab_contents->render_view_host()->routing_id();
tab_contents_->AddObserver(this);
}
}
void TabContentsObserver::TabContentsDestroyed(TabContents* tab) {
}
bool TabContentsObserver::OnMessageReceived(const IPC::Message& message) {
return false;
}
bool TabContentsObserver::Send(IPC::Message* message) {
if (!tab_contents_ || !tab_contents_->render_view_host()) {
delete message;
return false;
}
return tab_contents_->render_view_host()->Send(message);
}
int TabContentsObserver::routing_id() const {
if (!tab_contents_ || !tab_contents_->render_view_host())
return MSG_ROUTING_NONE;
return tab_contents_->render_view_host()->routing_id();
}
void TabContentsObserver::TabContentsDestroyed() {
// Do cleanup so that 'this' can safely be deleted from
// TabContentsDestroyed.
tab_contents_->RemoveObserver(this);
TabContents* tab = tab_contents_;
tab_contents_ = NULL;
TabContentsDestroyed(tab);
}
|