| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/views/about_chrome_view.h" | 5 #include "chrome/browser/ui/views/about_chrome_view.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <commdlg.h> | 8 #include <commdlg.h> |
| 9 #endif // defined(OS_WIN) | 9 #endif // defined(OS_WIN) |
| 10 | 10 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 chromium_url_(NULL), | 98 chromium_url_(NULL), |
| 99 open_source_url_(NULL), | 99 open_source_url_(NULL), |
| 100 terms_of_service_url_(NULL), | 100 terms_of_service_url_(NULL), |
| 101 restart_button_visible_(false), | 101 restart_button_visible_(false), |
| 102 chromium_url_appears_first_(true), | 102 chromium_url_appears_first_(true), |
| 103 text_direction_is_rtl_(false) { | 103 text_direction_is_rtl_(false) { |
| 104 DCHECK(profile); | 104 DCHECK(profile); |
| 105 | 105 |
| 106 Init(); | 106 Init(); |
| 107 | 107 |
| 108 #if defined(OS_WIN) | 108 #if defined(OS_WIN) && !defined(USE_AURA) |
| 109 google_updater_ = new GoogleUpdate(); | 109 google_updater_ = new GoogleUpdate(); |
| 110 google_updater_->set_status_listener(this); | 110 google_updater_->set_status_listener(this); |
| 111 #endif | 111 #endif |
| 112 | 112 |
| 113 if (kBackgroundBmp == NULL) { | 113 if (kBackgroundBmp == NULL) { |
| 114 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 114 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 115 kBackgroundBmp = rb.GetBitmapNamed(IDR_ABOUT_BACKGROUND_COLOR); | 115 kBackgroundBmp = rb.GetBitmapNamed(IDR_ABOUT_BACKGROUND_COLOR); |
| 116 } | 116 } |
| 117 } | 117 } |
| 118 | 118 |
| 119 AboutChromeView::~AboutChromeView() { | 119 AboutChromeView::~AboutChromeView() { |
| 120 #if defined(OS_WIN) | 120 #if defined(OS_WIN) && !defined(USE_AURA) |
| 121 // The Google Updater will hold a pointer to us until it reports status, so we | 121 // The Google Updater will hold a pointer to us until it reports status, so we |
| 122 // need to let it know that we will no longer be listening. | 122 // need to let it know that we will no longer be listening. |
| 123 if (google_updater_) | 123 if (google_updater_) |
| 124 google_updater_->set_status_listener(NULL); | 124 google_updater_->set_status_listener(NULL); |
| 125 #endif | 125 #endif |
| 126 } | 126 } |
| 127 | 127 |
| 128 void AboutChromeView::Init() { | 128 void AboutChromeView::Init() { |
| 129 text_direction_is_rtl_ = base::i18n::IsRTL(); | 129 text_direction_is_rtl_ = base::i18n::IsRTL(); |
| 130 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 130 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 if (is_add) { | 465 if (is_add) { |
| 466 parent->AddChildView(&update_label_); | 466 parent->AddChildView(&update_label_); |
| 467 parent->AddChildView(throbber_.get()); | 467 parent->AddChildView(throbber_.get()); |
| 468 parent->AddChildView(&success_indicator_); | 468 parent->AddChildView(&success_indicator_); |
| 469 success_indicator_.SetVisible(false); | 469 success_indicator_.SetVisible(false); |
| 470 parent->AddChildView(&update_available_indicator_); | 470 parent->AddChildView(&update_available_indicator_); |
| 471 update_available_indicator_.SetVisible(false); | 471 update_available_indicator_.SetVisible(false); |
| 472 parent->AddChildView(&timeout_indicator_); | 472 parent->AddChildView(&timeout_indicator_); |
| 473 timeout_indicator_.SetVisible(false); | 473 timeout_indicator_.SetVisible(false); |
| 474 | 474 |
| 475 #if defined(OS_WIN) | 475 #if defined(OS_WIN) && !defined(USE_AURA) |
| 476 // On-demand updates for Chrome don't work in Vista RTM when UAC is turned | 476 // On-demand updates for Chrome don't work in Vista RTM when UAC is turned |
| 477 // off. So, in this case we just want the About box to not mention | 477 // off. So, in this case we just want the About box to not mention |
| 478 // on-demand updates. Silent updates (in the background) should still | 478 // on-demand updates. Silent updates (in the background) should still |
| 479 // work as before - enabling UAC or installing the latest service pack | 479 // work as before - enabling UAC or installing the latest service pack |
| 480 // for Vista is another option. | 480 // for Vista is another option. |
| 481 if (!(base::win::GetVersion() == base::win::VERSION_VISTA && | 481 if (!(base::win::GetVersion() == base::win::VERSION_VISTA && |
| 482 (base::win::OSInfo::GetInstance()->service_pack().major == 0) && | 482 (base::win::OSInfo::GetInstance()->service_pack().major == 0) && |
| 483 !base::win::UserAccountControlIsEnabled())) { | 483 !base::win::UserAccountControlIsEnabled())) { |
| 484 UpdateStatus(UPGRADE_CHECK_STARTED, GOOGLE_UPDATE_NO_ERROR); | 484 UpdateStatus(UPGRADE_CHECK_STARTED, GOOGLE_UPDATE_NO_ERROR); |
| 485 // CheckForUpdate(false, ...) means don't upgrade yet. | 485 // CheckForUpdate(false, ...) means don't upgrade yet. |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 } else if (source == open_source_url_) { | 585 } else if (source == open_source_url_) { |
| 586 url = GURL(chrome::kChromeUICreditsURL); | 586 url = GURL(chrome::kChromeUICreditsURL); |
| 587 } else { | 587 } else { |
| 588 NOTREACHED() << "Unknown link source"; | 588 NOTREACHED() << "Unknown link source"; |
| 589 } | 589 } |
| 590 | 590 |
| 591 Browser* browser = BrowserList::GetLastActive(); | 591 Browser* browser = BrowserList::GetLastActive(); |
| 592 browser->OpenURL(url, GURL(), NEW_WINDOW, PageTransition::LINK); | 592 browser->OpenURL(url, GURL(), NEW_WINDOW, PageTransition::LINK); |
| 593 } | 593 } |
| 594 | 594 |
| 595 #if defined(OS_WIN) | 595 #if defined(OS_WIN) && !defined(USE_AURA) |
| 596 //////////////////////////////////////////////////////////////////////////////// | 596 //////////////////////////////////////////////////////////////////////////////// |
| 597 // AboutChromeView, GoogleUpdateStatusListener implementation: | 597 // AboutChromeView, GoogleUpdateStatusListener implementation: |
| 598 | 598 |
| 599 void AboutChromeView::OnReportResults(GoogleUpdateUpgradeResult result, | 599 void AboutChromeView::OnReportResults(GoogleUpdateUpgradeResult result, |
| 600 GoogleUpdateErrorCode error_code, | 600 GoogleUpdateErrorCode error_code, |
| 601 const std::wstring& version) { | 601 const std::wstring& version) { |
| 602 // Drop the last reference to the object so that it gets cleaned up here. | 602 // Drop the last reference to the object so that it gets cleaned up here. |
| 603 google_updater_ = NULL; | 603 google_updater_ = NULL; |
| 604 | 604 |
| 605 // Make a note of which version Google Update is reporting is the latest | 605 // Make a note of which version Google Update is reporting is the latest |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 // We have updated controls on the parent, so we need to update its layout. | 731 // We have updated controls on the parent, so we need to update its layout. |
| 732 parent()->Layout(); | 732 parent()->Layout(); |
| 733 | 733 |
| 734 // Check button may have appeared/disappeared. We cannot call this during | 734 // Check button may have appeared/disappeared. We cannot call this during |
| 735 // ViewHierarchyChanged because the view hasn't been added to a Widget yet. | 735 // ViewHierarchyChanged because the view hasn't been added to a Widget yet. |
| 736 if (GetWidget()) | 736 if (GetWidget()) |
| 737 GetDialogClientView()->UpdateDialogButtons(); | 737 GetDialogClientView()->UpdateDialogButtons(); |
| 738 } | 738 } |
| 739 | 739 |
| 740 #endif | 740 #endif |
| OLD | NEW |