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

Side by Side Diff: content/browser/tab_contents/tab_contents.cc

Issue 7453050: Plumb the title direction up to the renderer host (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 9 years, 4 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 "content/browser/tab_contents/tab_contents.h" 5 #include "content/browser/tab_contents/tab_contents.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after
1487 NavigationEntry* entry = controller_.GetEntryAtIndex(entry_index); 1487 NavigationEntry* entry = controller_.GetEntryAtIndex(entry_index);
1488 1488
1489 if (state == entry->content_state()) 1489 if (state == entry->content_state())
1490 return; // Nothing to update. 1490 return; // Nothing to update.
1491 entry->set_content_state(state); 1491 entry->set_content_state(state);
1492 controller_.NotifyEntryChanged(entry, entry_index); 1492 controller_.NotifyEntryChanged(entry, entry_index);
1493 } 1493 }
1494 1494
1495 void TabContents::UpdateTitle(RenderViewHost* rvh, 1495 void TabContents::UpdateTitle(RenderViewHost* rvh,
1496 int32 page_id, 1496 int32 page_id,
1497 const string16& title) { 1497 const string16& title,
1498 base::i18n::TextDirection title_direction) {
1498 // If we have a title, that's a pretty good indication that we've started 1499 // If we have a title, that's a pretty good indication that we've started
1499 // getting useful data. 1500 // getting useful data.
1500 SetNotWaitingForResponse(); 1501 SetNotWaitingForResponse();
1501 1502
1502 DCHECK(rvh == render_view_host()); 1503 DCHECK(rvh == render_view_host());
1503 NavigationEntry* entry = controller_.GetEntryWithPageID(rvh->site_instance(), 1504 NavigationEntry* entry = controller_.GetEntryWithPageID(rvh->site_instance(),
1504 page_id); 1505 page_id);
1505 1506
1507 // TODO(evan): make use of title_direction.
1508 // http://code.google.com/p/chromium/issues/detail?id=27094
1506 if (!UpdateTitleForEntry(entry, title)) 1509 if (!UpdateTitleForEntry(entry, title))
1507 return; 1510 return;
1508 1511
1509 // Broadcast notifications when the UI should be updated. 1512 // Broadcast notifications when the UI should be updated.
1510 if (entry == controller_.GetEntryAtOffset(0)) 1513 if (entry == controller_.GetEntryAtOffset(0))
1511 NotifyNavigationStateChanged(INVALIDATE_TITLE); 1514 NotifyNavigationStateChanged(INVALIDATE_TITLE);
1512 } 1515 }
1513 1516
1514 void TabContents::UpdateEncoding(RenderViewHost* render_view_host, 1517 void TabContents::UpdateEncoding(RenderViewHost* render_view_host,
1515 const std::string& encoding) { 1518 const std::string& encoding) {
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
1894 } 1897 }
1895 1898
1896 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { 1899 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) {
1897 render_manager_.SwapInRenderViewHost(rvh); 1900 render_manager_.SwapInRenderViewHost(rvh);
1898 } 1901 }
1899 1902
1900 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { 1903 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) {
1901 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); 1904 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh);
1902 rwh_view->SetSize(view()->GetContainerSize()); 1905 rwh_view->SetSize(view()->GetContainerSize());
1903 } 1906 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698