| 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 #include "chrome/browser/prerender/prerender_contents.h" | 5 #include "chrome/browser/prerender/prerender_contents.h" |
| 6 | 6 |
| 7 #include "base/i18n/rtl.h" |
| 7 #include "base/process_util.h" | 8 #include "base/process_util.h" |
| 8 #include "base/task.h" | 9 #include "base/task.h" |
| 9 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/background_contents_service.h" | 11 #include "chrome/browser/background_contents_service.h" |
| 11 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/prerender/prerender_final_status.h" | 13 #include "chrome/browser/prerender/prerender_final_status.h" |
| 13 #include "chrome/browser/prerender/prerender_manager.h" | 14 #include "chrome/browser/prerender/prerender_manager.h" |
| 14 #include "chrome/browser/prerender/prerender_render_widget_host_view.h" | 15 #include "chrome/browser/prerender/prerender_render_widget_host_view.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/renderer_preferences_util.h" | 17 #include "chrome/browser/renderer_preferences_util.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 navigate_params_.reset(p); | 260 navigate_params_.reset(p); |
| 260 | 261 |
| 261 if (!AddAliasURL(params.url)) { | 262 if (!AddAliasURL(params.url)) { |
| 262 Destroy(FINAL_STATUS_HTTPS); | 263 Destroy(FINAL_STATUS_HTTPS); |
| 263 return; | 264 return; |
| 264 } | 265 } |
| 265 | 266 |
| 266 url_ = params.url; | 267 url_ = params.url; |
| 267 } | 268 } |
| 268 | 269 |
| 269 void PrerenderContents::UpdateTitle(RenderViewHost* render_view_host, | 270 void PrerenderContents::UpdateTitle( |
| 270 int32 page_id, | 271 RenderViewHost* render_view_host, |
| 271 const string16& title, | 272 int32 page_id, |
| 272 WebKit::WebTextDirection title_direction) { | 273 const base::i18n::String16WithDirection& title) { |
| 273 if (title.empty()) | 274 if (title.string().empty()) |
| 274 return; | 275 return; |
| 275 | 276 |
| 276 // TODO(evan): use directionality of title. | 277 // TODO(evan): use directionality of title. |
| 277 // http://code.google.com/p/chromium/issues/detail?id=27094 | 278 // http://code.google.com/p/chromium/issues/detail?id=27094 |
| 278 title_ = title; | 279 title_ = title.string(); |
| 279 page_id_ = page_id; | 280 page_id_ = page_id; |
| 280 } | 281 } |
| 281 | 282 |
| 282 void PrerenderContents::RunJavaScriptMessage( | 283 void PrerenderContents::RunJavaScriptMessage( |
| 283 const std::wstring& message, | 284 const std::wstring& message, |
| 284 const std::wstring& default_prompt, | 285 const std::wstring& default_prompt, |
| 285 const GURL& frame_url, | 286 const GURL& frame_url, |
| 286 const int flags, | 287 const int flags, |
| 287 IPC::Message* reply_msg, | 288 IPC::Message* reply_msg, |
| 288 bool* did_suppress_message) { | 289 bool* did_suppress_message) { |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 return; | 557 return; |
| 557 | 558 |
| 558 size_t private_bytes, shared_bytes; | 559 size_t private_bytes, shared_bytes; |
| 559 if (metrics->GetMemoryBytes(&private_bytes, &shared_bytes)) { | 560 if (metrics->GetMemoryBytes(&private_bytes, &shared_bytes)) { |
| 560 if (private_bytes > kMaxPrerenderPrivateMB * 1024 * 1024) | 561 if (private_bytes > kMaxPrerenderPrivateMB * 1024 * 1024) |
| 561 Destroy(FINAL_STATUS_MEMORY_LIMIT_EXCEEDED); | 562 Destroy(FINAL_STATUS_MEMORY_LIMIT_EXCEEDED); |
| 562 } | 563 } |
| 563 } | 564 } |
| 564 | 565 |
| 565 } // namespace prerender | 566 } // namespace prerender |
| OLD | NEW |