| 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_MESSAGE_HANDLER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_UI_MESSAGE_HANDLER_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_WEB_UI_MESSAGE_HANDLER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_UI_MESSAGE_HANDLER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 114 |
| 115 // Sets the attached WebUI - exposed to subclasses for testing purposes. | 115 // Sets the attached WebUI - exposed to subclasses for testing purposes. |
| 116 void set_web_ui(WebUI* web_ui) { web_ui_ = web_ui; } | 116 void set_web_ui(WebUI* web_ui) { web_ui_ = web_ui; } |
| 117 | 117 |
| 118 private: | 118 private: |
| 119 // Provide external classes access to web_ui(), set_web_ui(), and | 119 // Provide external classes access to web_ui(), set_web_ui(), and |
| 120 // RenderViewReused. | 120 // RenderViewReused. |
| 121 friend class WebUIImpl; | 121 friend class WebUIImpl; |
| 122 friend class ::WebUIBrowserTest; | 122 friend class ::WebUIBrowserTest; |
| 123 | 123 |
| 124 // Called when a RenderView is reused to display a page (i.e. reload). | |
| 125 void RenderViewReused(); | |
| 126 | |
| 127 // TODO(dbeam): disallow JavaScript when a renderer process crashes. | 124 // TODO(dbeam): disallow JavaScript when a renderer process crashes. |
| 128 // http://crbug.com/610450 | 125 // http://crbug.com/610450 |
| 129 | 126 |
| 130 // True if the page is for JavaScript calls from this handler. | 127 // True if the page is for JavaScript calls from this handler. |
| 131 bool javascript_allowed_; | 128 bool javascript_allowed_; |
| 132 | 129 |
| 133 WebUI* web_ui_; | 130 WebUI* web_ui_; |
| 134 }; | 131 }; |
| 135 | 132 |
| 136 } // namespace content | 133 } // namespace content |
| 137 | 134 |
| 138 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_MESSAGE_HANDLER_H_ | 135 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_MESSAGE_HANDLER_H_ |
| OLD | NEW |