| 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_manager.h" | 5 #include "chrome/browser/prerender/prerender_manager.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 NotificationType::PRERENDER_CONTENTS_USED, | 343 NotificationType::PRERENDER_CONTENTS_USED, |
| 344 Source<std::pair<int, int> >(&child_route_pair), | 344 Source<std::pair<int, int> >(&child_route_pair), |
| 345 NotificationService::NoDetails()); | 345 NotificationService::NoDetails()); |
| 346 | 346 |
| 347 ViewHostMsg_FrameNavigate_Params* p = pc->navigate_params(); | 347 ViewHostMsg_FrameNavigate_Params* p = pc->navigate_params(); |
| 348 if (p != NULL) | 348 if (p != NULL) |
| 349 tc->DidNavigate(rvh, *p); | 349 tc->DidNavigate(rvh, *p); |
| 350 | 350 |
| 351 // TODO(evan): use directionality of title. | 351 // TODO(evan): use directionality of title. |
| 352 // http://code.google.com/p/chromium/issues/detail?id=27094 | 352 // http://code.google.com/p/chromium/issues/detail?id=27094 |
| 353 string16 title = pc->title(); | 353 string16 title_str = pc->title(); |
| 354 if (!title.empty()) { | 354 if (!title_str.empty()) { |
| 355 tc->UpdateTitle(rvh, pc->page_id(), title, | 355 base::i18n::String16WithDirection title(title_str, |
| 356 WebKit::WebTextDirectionLeftToRight); | 356 base::i18n::LEFT_TO_RIGHT); |
| 357 tc->UpdateTitle(rvh, pc->page_id(), title); |
| 357 } | 358 } |
| 358 | 359 |
| 359 GURL icon_url = pc->icon_url(); | 360 GURL icon_url = pc->icon_url(); |
| 360 if (!icon_url.is_empty()) { | 361 if (!icon_url.is_empty()) { |
| 361 std::vector<FaviconURL> urls; | 362 std::vector<FaviconURL> urls; |
| 362 urls.push_back(FaviconURL(icon_url, FaviconURL::FAVICON)); | 363 urls.push_back(FaviconURL(icon_url, FaviconURL::FAVICON)); |
| 363 tc->favicon_helper().OnUpdateFaviconURL(pc->page_id(), urls); | 364 tc->favicon_helper().OnUpdateFaviconURL(pc->page_id(), urls); |
| 364 } | 365 } |
| 365 | 366 |
| 366 if (pc->has_stopped_loading()) | 367 if (pc->has_stopped_loading()) |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 | 598 |
| 598 bool PrerenderManager::IsTabContentsPrerendered(TabContents* tc) const { | 599 bool PrerenderManager::IsTabContentsPrerendered(TabContents* tc) const { |
| 599 return prerendered_tc_set_.count(tc) > 0; | 600 return prerendered_tc_set_.count(tc) > 0; |
| 600 } | 601 } |
| 601 | 602 |
| 602 bool PrerenderManager::WouldTabContentsBePrerendered(TabContents* tc) const { | 603 bool PrerenderManager::WouldTabContentsBePrerendered(TabContents* tc) const { |
| 603 return would_be_prerendered_tc_set_.count(tc) > 0; | 604 return would_be_prerendered_tc_set_.count(tc) > 0; |
| 604 } | 605 } |
| 605 | 606 |
| 606 } // namespace prerender | 607 } // namespace prerender |
| OLD | NEW |