| 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 "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 2102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2113 } | 2113 } |
| 2114 | 2114 |
| 2115 // Tell the embedding application that the title of the active page has changed | 2115 // Tell the embedding application that the title of the active page has changed |
| 2116 void RenderViewImpl::UpdateTitle(WebFrame* frame, | 2116 void RenderViewImpl::UpdateTitle(WebFrame* frame, |
| 2117 const string16& title, | 2117 const string16& title, |
| 2118 WebTextDirection title_direction) { | 2118 WebTextDirection title_direction) { |
| 2119 // Ignore all but top level navigations. | 2119 // Ignore all but top level navigations. |
| 2120 if (frame->parent()) | 2120 if (frame->parent()) |
| 2121 return; | 2121 return; |
| 2122 | 2122 |
| 2123 std::string title_suffix = |
| 2124 GetVisibilityState() == WebKit::WebPageVisibilityStatePrerender ? |
| 2125 " (Prerender)" : ""; |
| 2123 base::debug::TraceLog::GetInstance()->UpdateProcessLabel( | 2126 base::debug::TraceLog::GetInstance()->UpdateProcessLabel( |
| 2124 routing_id_, UTF16ToUTF8(title)); | 2127 routing_id_, UTF16ToUTF8(title) + title_suffix); |
| 2125 | 2128 |
| 2126 string16 shortened_title = title.substr(0, kMaxTitleChars); | 2129 string16 shortened_title = title.substr(0, kMaxTitleChars); |
| 2127 Send(new ViewHostMsg_UpdateTitle(routing_id_, page_id_, shortened_title, | 2130 Send(new ViewHostMsg_UpdateTitle(routing_id_, page_id_, shortened_title, |
| 2128 title_direction)); | 2131 title_direction)); |
| 2129 } | 2132 } |
| 2130 | 2133 |
| 2131 void RenderViewImpl::UpdateEncoding(WebFrame* frame, | 2134 void RenderViewImpl::UpdateEncoding(WebFrame* frame, |
| 2132 const std::string& encoding_name) { | 2135 const std::string& encoding_name) { |
| 2133 // Only update main frame's encoding_name. | 2136 // Only update main frame's encoding_name. |
| 2134 if (webview()->mainFrame() == frame && | 2137 if (webview()->mainFrame() == frame && |
| (...skipping 4403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6538 for (size_t i = 0; i < icon_urls.size(); i++) { | 6541 for (size_t i = 0; i < icon_urls.size(); i++) { |
| 6539 WebURL url = icon_urls[i].iconURL(); | 6542 WebURL url = icon_urls[i].iconURL(); |
| 6540 if (!url.isEmpty()) | 6543 if (!url.isEmpty()) |
| 6541 urls.push_back(FaviconURL(url, | 6544 urls.push_back(FaviconURL(url, |
| 6542 ToFaviconType(icon_urls[i].iconType()))); | 6545 ToFaviconType(icon_urls[i].iconType()))); |
| 6543 } | 6546 } |
| 6544 SendUpdateFaviconURL(urls); | 6547 SendUpdateFaviconURL(urls); |
| 6545 } | 6548 } |
| 6546 | 6549 |
| 6547 } // namespace content | 6550 } // namespace content |
| OLD | NEW |