| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PUBLIC_BROWSER_WEB_UI_CONTROLLER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_UI_CONTROLLER_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_WEB_UI_CONTROLLER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_UI_CONTROLLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 const base::ListValue& args); | 35 const base::ListValue& args); |
| 36 | 36 |
| 37 // Called when RenderView is first created. This is *not* called for every | 37 // Called when RenderView is first created. This is *not* called for every |
| 38 // page load because in some cases a RenderView will be reused. In those | 38 // page load because in some cases a RenderView will be reused. In those |
| 39 // cases, RenderViewReused will be called instead. | 39 // cases, RenderViewReused will be called instead. |
| 40 virtual void RenderViewCreated(RenderViewHost* render_view_host) {} | 40 virtual void RenderViewCreated(RenderViewHost* render_view_host) {} |
| 41 | 41 |
| 42 // Called when a RenderView is reused to display a page. | 42 // Called when a RenderView is reused to display a page. |
| 43 virtual void RenderViewReused(RenderViewHost* render_view_host) {} | 43 virtual void RenderViewReused(RenderViewHost* render_view_host) {} |
| 44 | 44 |
| 45 // Called when this becomes the active WebUI instance for a re-used | |
| 46 // RenderView; this is the point at which this WebUI instance will receive | |
| 47 // DOM messages instead of the previous WebUI instance. | |
| 48 // | |
| 49 // If a WebUI instance has code that is usually triggered from a JavaScript | |
| 50 // onload handler, this should be overridden to check to see if the web page's | |
| 51 // DOM is still intact (e.g., due to a back/forward navigation that remains | |
| 52 // within the same page), and if so trigger that code manually since onload | |
| 53 // won't be run in that case. | |
| 54 virtual void DidBecomeActiveForReusedRenderView() {} | |
| 55 | |
| 56 WebUI* web_ui() const { return web_ui_; } | 45 WebUI* web_ui() const { return web_ui_; } |
| 57 | 46 |
| 58 private: | 47 private: |
| 59 WebUI* web_ui_; | 48 WebUI* web_ui_; |
| 60 }; | 49 }; |
| 61 | 50 |
| 62 } // namespace content | 51 } // namespace content |
| 63 | 52 |
| 64 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_CONTROLLER_H_ | 53 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_CONTROLLER_H_ |
| OLD | NEW |