diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-19 22:35:29 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-19 22:35:29 +0000 |
commit | 5cca3a55b3f1c25c5b3a19c3b42227aae34e4abf (patch) | |
tree | 01cd3db90399f7c24d3aea3593fd2d5feb35f106 /chrome/browser | |
parent | aac13f594195df51eb1e4e35ea2863659cb4de54 (diff) | |
download | chromium_src-5cca3a55b3f1c25c5b3a19c3b42227aae34e4abf.zip chromium_src-5cca3a55b3f1c25c5b3a19c3b42227aae34e4abf.tar.gz chromium_src-5cca3a55b3f1c25c5b3a19c3b42227aae34e4abf.tar.bz2 |
Move time formatters that only use ICU into base/time.*
This allows us to use the time formatters in, e.g., net
or webkit.
Remove CookieExpires since it's not used.
BUG=1164516
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1063 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/download_tab_view.cc | 5 | ||||
-rw-r--r-- | chrome/browser/history_view.cc | 13 | ||||
-rw-r--r-- | chrome/browser/page_info_window.cc | 4 | ||||
-rw-r--r-- | chrome/browser/printing/win_printing_context.cc | 6 | ||||
-rw-r--r-- | chrome/browser/views/options/cookies_view.cc | 6 |
5 files changed, 18 insertions, 16 deletions
diff --git a/chrome/browser/download_tab_view.cc b/chrome/browser/download_tab_view.cc index d675833..f2424a0 100644 --- a/chrome/browser/download_tab_view.cc +++ b/chrome/browser/download_tab_view.cc @@ -37,6 +37,7 @@ #include "base/file_util.h" #include "base/string_util.h" #include "base/task.h" +#include "base/time_format.h" #include "base/timer.h" #include "chrome/app/theme/theme_resources.h" #include "chrome/browser/browser_process.h" @@ -252,13 +253,13 @@ void DownloadItemTabView::LayoutDate() { CSize since_size; - since_->SetText(TimeFormat::FriendlyDay(model_->start_time(), NULL)); + since_->SetText(TimeFormat::RelativeDate(model_->start_time(), NULL)); since_->GetPreferredSize(&since_size); since_->SetBounds(kLeftMargin, kIconOffset, kDateSize, since_size.cy); since_->SetVisible(true); CSize date_size; - date_->SetText(TimeFormat::ShortDate(model_->start_time())); + date_->SetText(base::TimeFormatShortDate(model_->start_time())); date_->GetPreferredSize(&date_size); date_->SetBounds(kLeftMargin, since_size.cy + kVerticalPadding + kIconOffset, kDateSize, date_size.cy); diff --git a/chrome/browser/history_view.cc b/chrome/browser/history_view.cc index 7af3135..8cdc7a4 100644 --- a/chrome/browser/history_view.cc +++ b/chrome/browser/history_view.cc @@ -30,6 +30,7 @@ #include "chrome/browser/history_view.h" #include "base/string_util.h" +#include "base/time_format.h" #include "base/word_iterator.h" #include "chrome/browser/browsing_data_remover.h" #include "chrome/browser/drag_utils.h" @@ -475,9 +476,9 @@ void HistoryItemRenderer::Layout() { time_label_->SetText(std::wstring()); } else if (show_full_) { time_x = 0; - time_label_->SetText(TimeFormat::ShortDate(visit_time)); + time_label_->SetText(base::TimeFormatShortDate(visit_time)); } else { - time_label_->SetText(TimeFormat::TimeOfDay(visit_time)); + time_label_->SetText(base::TimeFormatTimeOfDay(visit_time)); } time_label_->GetPreferredSize(&time_size); @@ -983,14 +984,14 @@ void HistoryView::Paint(ChromeCanvas* canvas) { DCHECK(visit_time.ToInternalValue() > 0); // If it's the first day, then it has a special presentation. - std::wstring date_str = TimeFormat::FriendlyDay(visit_time, - &midnight_today); + std::wstring date_str = TimeFormat::RelativeDate(visit_time, + &midnight_today); if (date_str.empty()) { - date_str = TimeFormat::FriendlyDate(visit_time); + date_str = base::TimeFormatFriendlyDate(visit_time); } else { date_str = l10n_util::GetStringF( IDS_HISTORY_DATE_WITH_RELATIVE_TIME, - date_str, TimeFormat::FriendlyDate(visit_time)); + date_str, base::TimeFormatFriendlyDate(visit_time)); } // Draw date diff --git a/chrome/browser/page_info_window.cc b/chrome/browser/page_info_window.cc index b27f2ba..6a4bd25 100644 --- a/chrome/browser/page_info_window.cc +++ b/chrome/browser/page_info_window.cc @@ -33,6 +33,7 @@ #pragma comment(lib, "cryptui.lib") #include "base/string_util.h" +#include "base/time_format.h" #include "chrome/app/locales/locale_settings.h" #include "chrome/app/theme/theme_resources.h" #include "chrome/browser/browser_process.h" @@ -46,7 +47,6 @@ #include "chrome/common/pref_names.h" #include "chrome/common/pref_service.h" #include "chrome/common/resource_bundle.h" -#include "chrome/common/time_format.h" #include "chrome/common/win_util.h" #include "chrome/views/background.h" #include "chrome/views/grid_layout.h" @@ -445,7 +445,7 @@ void SecurityTabView::OnGotVisitCountToHost(HistoryService::Handle handle, l10n_util::GetString(IDS_PAGE_INFO_SECURITY_TAB_PERSONAL_HISTORY_TITLE), true, std::wstring(), l10n_util::GetStringF(IDS_PAGE_INFO_SECURITY_TAB_VISITED_BEFORE_TODAY, - TimeFormat::ShortDate(first_visit))); + base::TimeFormatShortDate(first_visit))); } Layout(); SchedulePaint(); diff --git a/chrome/browser/printing/win_printing_context.cc b/chrome/browser/printing/win_printing_context.cc index 1e3da12..cb275a8 100644 --- a/chrome/browser/printing/win_printing_context.cc +++ b/chrome/browser/printing/win_printing_context.cc @@ -33,10 +33,10 @@ #include "base/file_util.h" #include "base/gfx/platform_device_win.h" +#include "base/time_format.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/printing/print_job_manager.h" #include "chrome/common/gfx/emf.h" -#include "chrome/common/time_format.h" namespace { @@ -304,9 +304,9 @@ PrintingContext::Result PrintingContext::NewDocument( // Create a filename. std::wstring filename; Time now(Time::Now()); - filename = TimeFormat::ShortDateNumeric(now); + filename = base::TimeFormatShortDateNumeric(now); filename += L"_"; - filename += TimeFormat::TimeOfDay(now); + filename += base::TimeFormatTimeOfDay(now); filename += L"_"; filename += document_name; filename += L"_"; diff --git a/chrome/browser/views/options/cookies_view.cc b/chrome/browser/views/options/cookies_view.cc index 8d93fed..142a62b8 100644 --- a/chrome/browser/views/options/cookies_view.cc +++ b/chrome/browser/views/options/cookies_view.cc @@ -32,6 +32,7 @@ #include "chrome/browser/views/options/cookies_view.h" #include "base/string_util.h" +#include "base/time_format.h" #include "chrome/app/locales/locale_settings.h" #include "chrome/app/theme/theme_resources.h" #include "chrome/browser/standard_layout.h" @@ -39,7 +40,6 @@ #include "chrome/common/gfx/color_utils.h" #include "chrome/common/l10n_util.h" #include "chrome/common/resource_bundle.h" -#include "chrome/common/time_format.h" #include "chrome/common/win_util.h" #include "chrome/views/border.h" #include "chrome/views/grid_layout.h" @@ -403,11 +403,11 @@ void CookieInfoView::SetCookie( domain_value_field_->SetText(UTF8ToWide(domain)); path_value_field_->SetText(UTF8ToWide(cookie.Path())); created_value_field_->SetText( - TimeFormat::FriendlyDateAndTime(cookie.CreationDate())); + base::TimeFormatFriendlyDateAndTime(cookie.CreationDate())); if (cookie.DoesExpire()) { expires_value_field_->SetText( - TimeFormat::FriendlyDateAndTime(cookie.ExpiryDate())); + base::TimeFormatFriendlyDateAndTime(cookie.ExpiryDate())); } else { // TODO(deanm) need a string that the average user can understand // "When you quit or restart your browser" ? |