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

Side by Side Diff: chrome/browser/task_manager_resource_providers.cc

Issue 39022: Convert NavigationEntry title to string16. TabContents::GetTitle no longer ne... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/task_manager_resource_providers.h" 5 #include "chrome/browser/task_manager_resource_providers.h"
6 6
7 #include "base/file_version_info.h" 7 #include "base/file_version_info.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/process_util.h" 9 #include "base/process_util.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 28 matching lines...) Expand all
39 TaskManagerWebContentsResource::~TaskManagerWebContentsResource() { 39 TaskManagerWebContentsResource::~TaskManagerWebContentsResource() {
40 } 40 }
41 41
42 std::wstring TaskManagerWebContentsResource::GetTitle() const { 42 std::wstring TaskManagerWebContentsResource::GetTitle() const {
43 // GetTitle() and GetURL() can only be invoked when the WebContents has a 43 // GetTitle() and GetURL() can only be invoked when the WebContents has a
44 // controller. 44 // controller.
45 if (!web_contents_->controller()) 45 if (!web_contents_->controller())
46 return std::wstring(); 46 return std::wstring();
47 47
48 // Fall back on the URL if there's no title. 48 // Fall back on the URL if there's no title.
49 std::wstring tab_title(web_contents_->GetTitle()); 49 std::wstring tab_title(UTF16ToWideHack(web_contents_->GetTitle()));
50 if (tab_title.empty()) { 50 if (tab_title.empty()) {
51 tab_title = UTF8ToWide(web_contents_->GetURL().spec()); 51 tab_title = UTF8ToWide(web_contents_->GetURL().spec());
52 // Force URL to be LTR. 52 // Force URL to be LTR.
53 if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) 53 if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT)
54 l10n_util::WrapStringWithLTRFormatting(&tab_title); 54 l10n_util::WrapStringWithLTRFormatting(&tab_title);
55 } else { 55 } else {
56 // Since the tab_title will be concatenated with 56 // Since the tab_title will be concatenated with
57 // IDS_TASK_MANAGER_TAB_PREFIX, we need to explicitly set the tab_title to 57 // IDS_TASK_MANAGER_TAB_PREFIX, we need to explicitly set the tab_title to
58 // be LTR format if there is no strong RTL charater in it. Otherwise, if 58 // be LTR format if there is no strong RTL charater in it. Otherwise, if
59 // IDS_TASK_MANAGER_TAB_PREFIX is an RTL word, the concatenated result 59 // IDS_TASK_MANAGER_TAB_PREFIX is an RTL word, the concatenated result
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 } 521 }
522 522
523 void TaskManagerBrowserProcessResourceProvider::StartUpdating() { 523 void TaskManagerBrowserProcessResourceProvider::StartUpdating() {
524 task_manager_->AddResource(&resource_); 524 task_manager_->AddResource(&resource_);
525 } 525 }
526 526
527 void TaskManagerBrowserProcessResourceProvider::StopUpdating() { 527 void TaskManagerBrowserProcessResourceProvider::StopUpdating() {
528 } 528 }
529 529
530 530
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/web_contents.cc ('k') | chrome/browser/views/blocked_popup_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698