| 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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 | 325 |
| 326 NotificationService::current()->Notify( | 326 NotificationService::current()->Notify( |
| 327 NotificationType::PRERENDER_CONTENTS_USED, | 327 NotificationType::PRERENDER_CONTENTS_USED, |
| 328 Source<std::pair<int, int> >(&child_route_pair), | 328 Source<std::pair<int, int> >(&child_route_pair), |
| 329 NotificationService::NoDetails()); | 329 NotificationService::NoDetails()); |
| 330 | 330 |
| 331 ViewHostMsg_FrameNavigate_Params* p = pc->navigate_params(); | 331 ViewHostMsg_FrameNavigate_Params* p = pc->navigate_params(); |
| 332 if (p != NULL) | 332 if (p != NULL) |
| 333 tc->DidNavigate(rvh, *p); | 333 tc->DidNavigate(rvh, *p); |
| 334 | 334 |
| 335 // TODO(evan): use directionality of title. |
| 336 // http://code.google.com/p/chromium/issues/detail?id=27094 |
| 335 string16 title = pc->title(); | 337 string16 title = pc->title(); |
| 336 if (!title.empty()) | 338 if (!title.empty()) { |
| 337 tc->UpdateTitle(rvh, pc->page_id(), UTF16ToWideHack(title)); | 339 tc->UpdateTitle(rvh, pc->page_id(), title, |
| 340 WebKit::WebTextDirectionLeftToRight); |
| 341 } |
| 338 | 342 |
| 339 GURL icon_url = pc->icon_url(); | 343 GURL icon_url = pc->icon_url(); |
| 340 if (!icon_url.is_empty()) { | 344 if (!icon_url.is_empty()) { |
| 341 std::vector<FaviconURL> urls; | 345 std::vector<FaviconURL> urls; |
| 342 urls.push_back(FaviconURL(icon_url, FaviconURL::FAVICON)); | 346 urls.push_back(FaviconURL(icon_url, FaviconURL::FAVICON)); |
| 343 tc->favicon_helper().OnUpdateFaviconURL(pc->page_id(), urls); | 347 tc->favicon_helper().OnUpdateFaviconURL(pc->page_id(), urls); |
| 344 } | 348 } |
| 345 | 349 |
| 346 if (pc->has_stopped_loading()) | 350 if (pc->has_stopped_loading()) |
| 347 tc->DidStopLoading(); | 351 tc->DidStopLoading(); |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 | 581 |
| 578 bool PrerenderManager::IsTabContentsPrerendered(TabContents* tc) const { | 582 bool PrerenderManager::IsTabContentsPrerendered(TabContents* tc) const { |
| 579 return prerendered_tc_set_.count(tc) > 0; | 583 return prerendered_tc_set_.count(tc) > 0; |
| 580 } | 584 } |
| 581 | 585 |
| 582 bool PrerenderManager::WouldTabContentsBePrerendered(TabContents* tc) const { | 586 bool PrerenderManager::WouldTabContentsBePrerendered(TabContents* tc) const { |
| 583 return would_be_prerendered_tc_set_.count(tc) > 0; | 587 return would_be_prerendered_tc_set_.count(tc) > 0; |
| 584 } | 588 } |
| 585 | 589 |
| 586 } // namespace prerender | 590 } // namespace prerender |
| OLD | NEW |