| 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 "base/process_util.h" | 8 #include "base/process_util.h" |
| 9 #include "content/browser/tab_contents/navigation_controller.h" | 9 #include "content/browser/tab_contents/navigation_controller.h" |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 #include "content/public/common/page_transition_types.h" | 11 #include "content/public/common/page_transition_types.h" |
| 12 #include "ipc/ipc_channel.h" | 12 #include "ipc/ipc_channel.h" |
| 13 #include "webkit/glue/window_open_disposition.h" | 13 #include "webkit/glue/window_open_disposition.h" |
| 14 | 14 |
| 15 class RenderViewHost; | 15 class RenderViewHost; |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 struct FrameNavigateParams; | 18 struct FrameNavigateParams; |
| 19 struct Referrer; |
| 19 } | 20 } |
| 20 | 21 |
| 21 // An observer API implemented by classes which are interested in various page | 22 // An observer API implemented by classes which are interested in various page |
| 22 // load events from TabContents. They also get a chance to filter IPC messages. | 23 // load events from TabContents. They also get a chance to filter IPC messages. |
| 23 class CONTENT_EXPORT TabContentsObserver : public IPC::Channel::Listener, | 24 class CONTENT_EXPORT TabContentsObserver : public IPC::Channel::Listener, |
| 24 public IPC::Message::Sender { | 25 public IPC::Message::Sender { |
| 25 public: | 26 public: |
| 26 virtual void RenderViewCreated(RenderViewHost* render_view_host); | 27 virtual void RenderViewCreated(RenderViewHost* render_view_host); |
| 27 virtual void RenderViewDeleted(RenderViewHost* render_view_host); | 28 virtual void RenderViewDeleted(RenderViewHost* render_view_host); |
| 28 virtual void RenderViewReady(); | 29 virtual void RenderViewReady(); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 const string16& error_description); | 69 const string16& error_description); |
| 69 virtual void DidGetUserGesture(); | 70 virtual void DidGetUserGesture(); |
| 70 virtual void DidGetIgnoredUIEvent(); | 71 virtual void DidGetIgnoredUIEvent(); |
| 71 virtual void DidBecomeSelected(); | 72 virtual void DidBecomeSelected(); |
| 72 | 73 |
| 73 virtual void DidStartLoading(); | 74 virtual void DidStartLoading(); |
| 74 virtual void DidStopLoading(); | 75 virtual void DidStopLoading(); |
| 75 virtual void StopNavigation(); | 76 virtual void StopNavigation(); |
| 76 | 77 |
| 77 virtual void DidOpenURL(const GURL& url, | 78 virtual void DidOpenURL(const GURL& url, |
| 78 const GURL& referrer, | 79 const content::Referrer& referrer, |
| 79 WindowOpenDisposition disposition, | 80 WindowOpenDisposition disposition, |
| 80 content::PageTransition transition); | 81 content::PageTransition transition); |
| 81 | 82 |
| 82 virtual void DidOpenRequestedURL(TabContents* new_contents, | 83 virtual void DidOpenRequestedURL(TabContents* new_contents, |
| 83 const GURL& url, | 84 const GURL& url, |
| 84 const GURL& referrer, | 85 const content::Referrer& referrer, |
| 85 WindowOpenDisposition disposition, | 86 WindowOpenDisposition disposition, |
| 86 content::PageTransition transition, | 87 content::PageTransition transition, |
| 87 int64 source_frame_id); | 88 int64 source_frame_id); |
| 88 | 89 |
| 89 virtual void AppCacheAccessed(const GURL& manifest_url, | 90 virtual void AppCacheAccessed(const GURL& manifest_url, |
| 90 bool blocked_by_policy); | 91 bool blocked_by_policy); |
| 91 #if 0 | 92 #if 0 |
| 92 // For unifying with delegate... | 93 // For unifying with delegate... |
| 93 | 94 |
| 94 // Notifies the delegate that this contents is starting or is done loading | 95 // Notifies the delegate that this contents is starting or is done loading |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 // Invoked from TabContents. Invokes TabContentsDestroyed and NULL out | 139 // Invoked from TabContents. Invokes TabContentsDestroyed and NULL out |
| 139 // |tab_contents_|. | 140 // |tab_contents_|. |
| 140 void TabContentsDestroyed(); | 141 void TabContentsDestroyed(); |
| 141 | 142 |
| 142 TabContents* tab_contents_; | 143 TabContents* tab_contents_; |
| 143 | 144 |
| 144 DISALLOW_COPY_AND_ASSIGN(TabContentsObserver); | 145 DISALLOW_COPY_AND_ASSIGN(TabContentsObserver); |
| 145 }; | 146 }; |
| 146 | 147 |
| 147 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_OBSERVER_H_ | 148 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_OBSERVER_H_ |
| OLD | NEW |