| 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 #include "chrome/renderer/chrome_render_view_observer.h" | 5 #include "chrome/renderer/chrome_render_view_observer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 // Truncate the strings we send to the browser process. | 126 // Truncate the strings we send to the browser process. |
| 127 web_app_info.title = | 127 web_app_info.title = |
| 128 web_app_info.title.substr(0, chrome::kMaxMetaTagAttributeLength); | 128 web_app_info.title.substr(0, chrome::kMaxMetaTagAttributeLength); |
| 129 web_app_info.description = | 129 web_app_info.description = |
| 130 web_app_info.description.substr(0, chrome::kMaxMetaTagAttributeLength); | 130 web_app_info.description.substr(0, chrome::kMaxMetaTagAttributeLength); |
| 131 | 131 |
| 132 Send(new ChromeViewHostMsg_DidGetWebApplicationInfo( | 132 Send(new ChromeViewHostMsg_DidGetWebApplicationInfo( |
| 133 routing_id(), web_app_info)); | 133 routing_id(), web_app_info)); |
| 134 } | 134 } |
| 135 | 135 |
| 136 void ChromeRenderViewObserver::OnSetWindowFeatures( | 136 void ChromeRenderViewObserver::OnSetWindowFeatures() { |
| 137 const WebWindowFeatures& window_features) { | 137 render_view()->GetWebView()->setWindowFeatures(WebWindowFeatures()); |
| 138 render_view()->GetWebView()->setWindowFeatures(window_features); | |
| 139 } | 138 } |
| 140 | 139 |
| 141 void ChromeRenderViewObserver::Navigate(const GURL& url) { | 140 void ChromeRenderViewObserver::Navigate(const GURL& url) { |
| 142 // Execute cache clear operations that were postponed until a navigation | 141 // Execute cache clear operations that were postponed until a navigation |
| 143 // event (including tab reload). | 142 // event (including tab reload). |
| 144 if (web_cache_impl_) | 143 if (web_cache_impl_) |
| 145 web_cache_impl_->ExecutePendingClearCache(); | 144 web_cache_impl_->ExecutePendingClearCache(); |
| 146 } | 145 } |
| 147 | 146 |
| 148 #if BUILDFLAG(ENABLE_EXTENSIONS) | 147 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 171 !webui_javascript_.empty()) { | 170 !webui_javascript_.empty()) { |
| 172 for (const auto& script : webui_javascript_) | 171 for (const auto& script : webui_javascript_) |
| 173 render_view()->GetMainRenderFrame()->ExecuteJavaScript(script); | 172 render_view()->GetMainRenderFrame()->ExecuteJavaScript(script); |
| 174 webui_javascript_.clear(); | 173 webui_javascript_.clear(); |
| 175 } | 174 } |
| 176 } | 175 } |
| 177 | 176 |
| 178 void ChromeRenderViewObserver::OnDestruct() { | 177 void ChromeRenderViewObserver::OnDestruct() { |
| 179 delete this; | 178 delete this; |
| 180 } | 179 } |
| OLD | NEW |