OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/task_manager_resource_providers.h" | 5 #include "chrome/browser/task_manager/task_manager_resource_providers.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 131 matching lines...) Loading... |
142 } else { | 142 } else { |
143 // Since the tab_title will be concatenated with | 143 // Since the tab_title will be concatenated with |
144 // IDS_TASK_MANAGER_TAB_PREFIX, we need to explicitly set the tab_title to | 144 // IDS_TASK_MANAGER_TAB_PREFIX, we need to explicitly set the tab_title to |
145 // be LTR format if there is no strong RTL charater in it. Otherwise, if | 145 // be LTR format if there is no strong RTL charater in it. Otherwise, if |
146 // IDS_TASK_MANAGER_TAB_PREFIX is an RTL word, the concatenated result | 146 // IDS_TASK_MANAGER_TAB_PREFIX is an RTL word, the concatenated result |
147 // might be wrong. For example, http://mail.yahoo.com, whose title is | 147 // might be wrong. For example, http://mail.yahoo.com, whose title is |
148 // "Yahoo! Mail: The best web-based Email!", without setting it explicitly | 148 // "Yahoo! Mail: The best web-based Email!", without setting it explicitly |
149 // as LTR format, the concatenated result will be "!Yahoo! Mail: The best | 149 // as LTR format, the concatenated result will be "!Yahoo! Mail: The best |
150 // web-based Email :BAT", in which the capital letters "BAT" stands for | 150 // web-based Email :BAT", in which the capital letters "BAT" stands for |
151 // the Hebrew word for "tab". | 151 // the Hebrew word for "tab". |
152 base::i18n::AdjustStringForLocaleDirection(tab_title, &tab_title); | 152 base::i18n::AdjustStringForLocaleDirection(&tab_title); |
153 } | 153 } |
154 | 154 |
155 return l10n_util::GetStringF(IDS_TASK_MANAGER_TAB_PREFIX, tab_title); | 155 return l10n_util::GetStringF(IDS_TASK_MANAGER_TAB_PREFIX, tab_title); |
156 } | 156 } |
157 | 157 |
158 | 158 |
159 SkBitmap TaskManagerTabContentsResource::GetIcon() const { | 159 SkBitmap TaskManagerTabContentsResource::GetIcon() const { |
160 return tab_contents_->GetFavIcon(); | 160 return tab_contents_->GetFavIcon(); |
161 } | 161 } |
162 | 162 |
(...skipping 187 matching lines...) Loading... |
350 background_contents_(background_contents), | 350 background_contents_(background_contents), |
351 application_name_(application_name) { | 351 application_name_(application_name) { |
352 // Just use the same icon that other extension resources do. | 352 // Just use the same icon that other extension resources do. |
353 // TODO(atwilson): Use the favicon when that's available. | 353 // TODO(atwilson): Use the favicon when that's available. |
354 if (!default_icon_) { | 354 if (!default_icon_) { |
355 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 355 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
356 default_icon_ = rb.GetBitmapNamed(IDR_PLUGIN); | 356 default_icon_ = rb.GetBitmapNamed(IDR_PLUGIN); |
357 } | 357 } |
358 // Ensure that the string has the appropriate direction markers (see comment | 358 // Ensure that the string has the appropriate direction markers (see comment |
359 // in TaskManagerTabContentsResource::GetTitle()). | 359 // in TaskManagerTabContentsResource::GetTitle()). |
360 base::i18n::AdjustStringForLocaleDirection(application_name_, | 360 base::i18n::AdjustStringForLocaleDirection(&application_name_); |
361 &application_name_); | |
362 } | 361 } |
363 | 362 |
364 TaskManagerBackgroundContentsResource::~TaskManagerBackgroundContentsResource( | 363 TaskManagerBackgroundContentsResource::~TaskManagerBackgroundContentsResource( |
365 ) { | 364 ) { |
366 } | 365 } |
367 | 366 |
368 std::wstring TaskManagerBackgroundContentsResource::GetTitle() const { | 367 std::wstring TaskManagerBackgroundContentsResource::GetTitle() const { |
369 std::wstring title = application_name_; | 368 std::wstring title = application_name_; |
370 | 369 |
371 if (title.empty()) { | 370 if (title.empty()) { |
(...skipping 856 matching lines...) Loading... |
1228 | 1227 |
1229 return &resource_; | 1228 return &resource_; |
1230 } | 1229 } |
1231 | 1230 |
1232 void TaskManagerBrowserProcessResourceProvider::StartUpdating() { | 1231 void TaskManagerBrowserProcessResourceProvider::StartUpdating() { |
1233 task_manager_->AddResource(&resource_); | 1232 task_manager_->AddResource(&resource_); |
1234 } | 1233 } |
1235 | 1234 |
1236 void TaskManagerBrowserProcessResourceProvider::StopUpdating() { | 1235 void TaskManagerBrowserProcessResourceProvider::StopUpdating() { |
1237 } | 1236 } |
OLD | NEW |