| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |