OLD | NEW |
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 #ifndef CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_OBSERVER_H_ | 5 #ifndef CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_OBSERVER_H_ |
6 #define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_OBSERVER_H_ | 6 #define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_OBSERVER_H_ |
7 | 7 |
8 #include "content/browser/tab_contents/navigation_controller.h" | 8 #include "content/browser/tab_contents/navigation_controller.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "content/common/page_transition_types.h" | 10 #include "content/public/common/page_transition_types.h" |
11 #include "ipc/ipc_channel.h" | 11 #include "ipc/ipc_channel.h" |
12 #include "webkit/glue/window_open_disposition.h" | 12 #include "webkit/glue/window_open_disposition.h" |
13 | 13 |
14 class RenderViewHost; | 14 class RenderViewHost; |
15 struct ViewHostMsg_FrameNavigate_Params; | 15 struct ViewHostMsg_FrameNavigate_Params; |
16 | 16 |
17 // An observer API implemented by classes which are interested in various page | 17 // An observer API implemented by classes which are interested in various page |
18 // load events from TabContents. They also get a chance to filter IPC messages. | 18 // load events from TabContents. They also get a chance to filter IPC messages. |
19 class CONTENT_EXPORT TabContentsObserver : public IPC::Channel::Listener, | 19 class CONTENT_EXPORT TabContentsObserver : public IPC::Channel::Listener, |
20 public IPC::Message::Sender { | 20 public IPC::Message::Sender { |
(...skipping 15 matching lines...) Expand all Loading... |
36 bool is_main_frame, | 36 bool is_main_frame, |
37 const GURL& validated_url, | 37 const GURL& validated_url, |
38 bool is_error_page, | 38 bool is_error_page, |
39 RenderViewHost* render_view_host); | 39 RenderViewHost* render_view_host); |
40 virtual void ProvisionalChangeToMainFrameUrl(const GURL& url, | 40 virtual void ProvisionalChangeToMainFrameUrl(const GURL& url, |
41 const GURL& opener_url); | 41 const GURL& opener_url); |
42 virtual void DidCommitProvisionalLoadForFrame( | 42 virtual void DidCommitProvisionalLoadForFrame( |
43 int64 frame_id, | 43 int64 frame_id, |
44 bool is_main_frame, | 44 bool is_main_frame, |
45 const GURL& url, | 45 const GURL& url, |
46 PageTransition::Type transition_type); | 46 content::PageTransition transition_type); |
47 virtual void DidFailProvisionalLoad(int64 frame_id, | 47 virtual void DidFailProvisionalLoad(int64 frame_id, |
48 bool is_main_frame, | 48 bool is_main_frame, |
49 const GURL& validated_url, | 49 const GURL& validated_url, |
50 int error_code, | 50 int error_code, |
51 const string16& error_description); | 51 const string16& error_description); |
52 virtual void DocumentLoadedInFrame(int64 frame_id); | 52 virtual void DocumentLoadedInFrame(int64 frame_id); |
53 virtual void DidFinishLoad(int64 frame_id); | 53 virtual void DidFinishLoad(int64 frame_id); |
54 virtual void DidGetUserGesture(); | 54 virtual void DidGetUserGesture(); |
55 virtual void DidGetIgnoredUIEvent(); | 55 virtual void DidGetIgnoredUIEvent(); |
56 virtual void DidBecomeSelected(); | 56 virtual void DidBecomeSelected(); |
57 | 57 |
58 virtual void DidStartLoading(); | 58 virtual void DidStartLoading(); |
59 virtual void DidStopLoading(); | 59 virtual void DidStopLoading(); |
60 virtual void RenderViewGone(); | 60 virtual void RenderViewGone(); |
61 virtual void StopNavigation(); | 61 virtual void StopNavigation(); |
62 | 62 |
63 virtual void DidOpenURL(const GURL& url, | 63 virtual void DidOpenURL(const GURL& url, |
64 const GURL& referrer, | 64 const GURL& referrer, |
65 WindowOpenDisposition disposition, | 65 WindowOpenDisposition disposition, |
66 PageTransition::Type transition); | 66 content::PageTransition transition); |
67 | 67 |
68 virtual void DidOpenRequestedURL(TabContents* new_contents, | 68 virtual void DidOpenRequestedURL(TabContents* new_contents, |
69 const GURL& url, | 69 const GURL& url, |
70 const GURL& referrer, | 70 const GURL& referrer, |
71 WindowOpenDisposition disposition, | 71 WindowOpenDisposition disposition, |
72 PageTransition::Type transition, | 72 content::PageTransition transition, |
73 int64 source_frame_id); | 73 int64 source_frame_id); |
74 | 74 |
75 virtual void AppCacheAccessed(const GURL& manifest_url, | 75 virtual void AppCacheAccessed(const GURL& manifest_url, |
76 bool blocked_by_policy); | 76 bool blocked_by_policy); |
77 #if 0 | 77 #if 0 |
78 // For unifying with delegate... | 78 // For unifying with delegate... |
79 | 79 |
80 // Notifies the delegate that this contents is starting or is done loading | 80 // Notifies the delegate that this contents is starting or is done loading |
81 // some resource. The delegate should use this notification to represent | 81 // some resource. The delegate should use this notification to represent |
82 // loading feedback. See TabContents::IsLoading() | 82 // loading feedback. See TabContents::IsLoading() |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 TabContents* tab_contents_; | 128 TabContents* tab_contents_; |
129 | 129 |
130 // The routing ID of the associated TabContents. | 130 // The routing ID of the associated TabContents. |
131 int routing_id_; | 131 int routing_id_; |
132 | 132 |
133 DISALLOW_COPY_AND_ASSIGN(TabContentsObserver); | 133 DISALLOW_COPY_AND_ASSIGN(TabContentsObserver); |
134 }; | 134 }; |
135 | 135 |
136 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_OBSERVER_H_ | 136 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_OBSERVER_H_ |
OLD | NEW |