| OLD | NEW | 
|    1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |    1 // Copyright (c) 2009 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/views/about_chrome_view.h" |    5 #include "chrome/browser/views/about_chrome_view.h" | 
|    6  |    6  | 
|    7 #include "app/bidi_line_iterator.h" |    7 #include "app/bidi_line_iterator.h" | 
|    8 #include "app/gfx/canvas.h" |    8 #include "app/gfx/canvas.h" | 
|    9 #include "app/l10n_util.h" |    9 #include "app/l10n_util.h" | 
|   10 #include "app/resource_bundle.h" |   10 #include "app/resource_bundle.h" | 
|   11 #include "base/callback.h" |   11 #include "base/callback.h" | 
|   12 #include "base/file_version_info.h" |   12 #include "base/file_version_info.h" | 
 |   13 #include "base/i18n/rtl.h" | 
|   13 #include "base/i18n/word_iterator.h" |   14 #include "base/i18n/word_iterator.h" | 
|   14 #include "base/utf_string_conversions.h" |   15 #include "base/utf_string_conversions.h" | 
|   15 #include "chrome/browser/browser_list.h" |   16 #include "chrome/browser/browser_list.h" | 
|   16 #include "chrome/browser/metrics/user_metrics.h" |   17 #include "chrome/browser/metrics/user_metrics.h" | 
|   17 #include "chrome/common/chrome_constants.h" |   18 #include "chrome/common/chrome_constants.h" | 
|   18 #include "chrome/common/platform_util.h" |   19 #include "chrome/common/platform_util.h" | 
|   19 #include "chrome/common/url_constants.h" |   20 #include "chrome/common/url_constants.h" | 
|   20 #include "gfx/color_utils.h" |   21 #include "gfx/color_utils.h" | 
|   21 #include "grit/chromium_strings.h" |   22 #include "grit/chromium_strings.h" | 
|   22 #include "grit/generated_resources.h" |   23 #include "grit/generated_resources.h" | 
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  120 AboutChromeView::~AboutChromeView() { |  121 AboutChromeView::~AboutChromeView() { | 
|  121 #if defined(OS_WIN) || defined(OS_CHROMEOS) |  122 #if defined(OS_WIN) || defined(OS_CHROMEOS) | 
|  122   // The Google Updater will hold a pointer to us until it reports status, so we |  123   // The Google Updater will hold a pointer to us until it reports status, so we | 
|  123   // need to let it know that we will no longer be listening. |  124   // need to let it know that we will no longer be listening. | 
|  124   if (google_updater_) |  125   if (google_updater_) | 
|  125     google_updater_->set_status_listener(NULL); |  126     google_updater_->set_status_listener(NULL); | 
|  126 #endif |  127 #endif | 
|  127 } |  128 } | 
|  128  |  129  | 
|  129 void AboutChromeView::Init() { |  130 void AboutChromeView::Init() { | 
|  130   text_direction_is_rtl_ = |  131   text_direction_is_rtl_ = base::i18n::IsRTL(); | 
|  131       l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT; |  | 
|  132   ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |  132   ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 
|  133  |  133  | 
|  134   scoped_ptr<FileVersionInfo> version_info( |  134   scoped_ptr<FileVersionInfo> version_info( | 
|  135       FileVersionInfo::CreateFileVersionInfoForCurrentModule()); |  135       FileVersionInfo::CreateFileVersionInfoForCurrentModule()); | 
|  136   if (version_info.get() == NULL) { |  136   if (version_info.get() == NULL) { | 
|  137     NOTREACHED() << L"Failed to initialize about window"; |  137     NOTREACHED() << L"Failed to initialize about window"; | 
|  138     return; |  138     return; | 
|  139   } |  139   } | 
|  140  |  140  | 
|  141   current_version_ = version_info->file_version(); |  141   current_version_ = version_info->file_version(); | 
| (...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  864           installer::Version::GetVersionFromString(current_version_)); |  864           installer::Version::GetVersionFromString(current_version_)); | 
|  865       if (!installed_version.get() || |  865       if (!installed_version.get() || | 
|  866           !installed_version->IsHigherThan(running_version.get())) { |  866           !installed_version->IsHigherThan(running_version.get())) { | 
|  867 #endif |  867 #endif | 
|  868         UserMetrics::RecordAction("UpgradeCheck_AlreadyUpToDate", profile_); |  868         UserMetrics::RecordAction("UpgradeCheck_AlreadyUpToDate", profile_); | 
|  869         check_button_status_ = CHECKBUTTON_HIDDEN; |  869         check_button_status_ = CHECKBUTTON_HIDDEN; | 
|  870         std::wstring update_label_text = |  870         std::wstring update_label_text = | 
|  871             l10n_util::GetStringF(IDS_UPGRADE_ALREADY_UP_TO_DATE, |  871             l10n_util::GetStringF(IDS_UPGRADE_ALREADY_UP_TO_DATE, | 
|  872                                   l10n_util::GetString(IDS_PRODUCT_NAME), |  872                                   l10n_util::GetString(IDS_PRODUCT_NAME), | 
|  873                                   current_version_); |  873                                   current_version_); | 
|  874         if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) { |  874         if (base::i18n::IsRTL()) { | 
|  875           update_label_text.push_back( |  875           update_label_text.push_back( | 
|  876               static_cast<wchar_t>(l10n_util::kLeftToRightMark)); |  876               static_cast<wchar_t>(base::i18n::kLeftToRightMark)); | 
|  877         } |  877         } | 
|  878         update_label_.SetText(update_label_text); |  878         update_label_.SetText(update_label_text); | 
|  879         show_success_indicator = true; |  879         show_success_indicator = true; | 
|  880         break; |  880         break; | 
|  881 #if defined(OS_WIN) |  881 #if defined(OS_WIN) | 
|  882       } |  882       } | 
|  883 #endif |  883 #endif | 
|  884       // No break here as we want to notify user about upgrade if there is one. |  884       // No break here as we want to notify user about upgrade if there is one. | 
|  885     } |  885     } | 
|  886     case UPGRADE_SUCCESSFUL: { |  886     case UPGRADE_SUCCESSFUL: { | 
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  929   View* parent = GetParent(); |  929   View* parent = GetParent(); | 
|  930   parent->Layout(); |  930   parent->Layout(); | 
|  931  |  931  | 
|  932   // Check button may have appeared/disappeared. We cannot call this during |  932   // Check button may have appeared/disappeared. We cannot call this during | 
|  933   // ViewHierarchyChanged because the |window()| pointer hasn't been set yet. |  933   // ViewHierarchyChanged because the |window()| pointer hasn't been set yet. | 
|  934   if (window()) |  934   if (window()) | 
|  935     GetDialogClientView()->UpdateDialogButtons(); |  935     GetDialogClientView()->UpdateDialogButtons(); | 
|  936 } |  936 } | 
|  937  |  937  | 
|  938 #endif |  938 #endif | 
| OLD | NEW |