Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: chrome/browser/prerender/prerender_manager.cc

Issue 6878089: Add and use a base::i18n::StringWithDirection for carrying titles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
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. 335 // TODO(evan): use directionality of title.
336 // http://code.google.com/p/chromium/issues/detail?id=27094 336 // http://code.google.com/p/chromium/issues/detail?id=27094
337 string16 title = pc->title(); 337 string16 title = pc->title();
338 if (!title.empty()) { 338 if (!title.empty()) {
339 tc->UpdateTitle(rvh, pc->page_id(), title, 339 tc->UpdateTitle(rvh, pc->page_id(),
340 WebKit::WebTextDirectionLeftToRight); 340 base::i18n::StringWithDirection(title,
341 base::i18n::LEFT_TO_RIGHT));
341 } 342 }
342 343
343 GURL icon_url = pc->icon_url(); 344 GURL icon_url = pc->icon_url();
344 if (!icon_url.is_empty()) { 345 if (!icon_url.is_empty()) {
345 std::vector<FaviconURL> urls; 346 std::vector<FaviconURL> urls;
346 urls.push_back(FaviconURL(icon_url, FaviconURL::FAVICON)); 347 urls.push_back(FaviconURL(icon_url, FaviconURL::FAVICON));
347 tc->favicon_helper().OnUpdateFaviconURL(pc->page_id(), urls); 348 tc->favicon_helper().OnUpdateFaviconURL(pc->page_id(), urls);
348 } 349 }
349 350
350 if (pc->has_stopped_loading()) 351 if (pc->has_stopped_loading())
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 582
582 bool PrerenderManager::IsTabContentsPrerendered(TabContents* tc) const { 583 bool PrerenderManager::IsTabContentsPrerendered(TabContents* tc) const {
583 return prerendered_tc_set_.count(tc) > 0; 584 return prerendered_tc_set_.count(tc) > 0;
584 } 585 }
585 586
586 bool PrerenderManager::WouldTabContentsBePrerendered(TabContents* tc) const { 587 bool PrerenderManager::WouldTabContentsBePrerendered(TabContents* tc) const {
587 return would_be_prerendered_tc_set_.count(tc) > 0; 588 return would_be_prerendered_tc_set_.count(tc) > 0;
588 } 589 }
589 590
590 } // namespace prerender 591 } // namespace prerender
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698