| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 |
| 11 #include <algorithm> | 11 #include <algorithm> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/i18n/rtl.h" | 15 #include "base/i18n/rtl.h" |
| 16 #include "base/string_number_conversions.h" | 16 #include "base/string_number_conversions.h" |
| 17 #include "base/threading/thread_restrictions.h" | 17 #include "base/threading/thread_restrictions.h" |
| 18 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
| 19 #include "base/win/windows_version.h" | 19 #include "base/win/windows_version.h" |
| 20 #include "chrome/browser/google/google_util.h" | 20 #include "chrome/browser/google/google_util.h" |
| 21 #include "chrome/browser/prefs/pref_service.h" | 21 #include "chrome/browser/prefs/pref_service.h" |
| 22 #include "chrome/browser/ui/browser.h" |
| 23 #include "chrome/browser/ui/browser_finder.h" |
| 22 #include "chrome/browser/ui/browser_list.h" | 24 #include "chrome/browser/ui/browser_list.h" |
| 23 #include "chrome/common/chrome_constants.h" | 25 #include "chrome/common/chrome_constants.h" |
| 24 #include "chrome/common/chrome_version_info.h" | 26 #include "chrome/common/chrome_version_info.h" |
| 25 #include "chrome/common/url_constants.h" | 27 #include "chrome/common/url_constants.h" |
| 26 #include "chrome/installer/util/browser_distribution.h" | 28 #include "chrome/installer/util/browser_distribution.h" |
| 27 #include "content/public/browser/user_metrics.h" | 29 #include "content/public/browser/user_metrics.h" |
| 28 #include "grit/chromium_strings.h" | 30 #include "grit/chromium_strings.h" |
| 29 #include "grit/generated_resources.h" | 31 #include "grit/generated_resources.h" |
| 30 #include "grit/locale_settings.h" | 32 #include "grit/locale_settings.h" |
| 31 #include "grit/theme_resources.h" | 33 #include "grit/theme_resources.h" |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 url = GURL(chrome::kChromeUITermsURL); | 616 url = GURL(chrome::kChromeUITermsURL); |
| 615 } else if (source == chromium_url_) { | 617 } else if (source == chromium_url_) { |
| 616 url = google_util::AppendGoogleLocaleParam( | 618 url = google_util::AppendGoogleLocaleParam( |
| 617 GURL(chrome::kChromiumProjectURL)); | 619 GURL(chrome::kChromiumProjectURL)); |
| 618 } else if (source == open_source_url_) { | 620 } else if (source == open_source_url_) { |
| 619 url = GURL(chrome::kChromeUICreditsURL); | 621 url = GURL(chrome::kChromeUICreditsURL); |
| 620 } else { | 622 } else { |
| 621 NOTREACHED() << "Unknown link source"; | 623 NOTREACHED() << "Unknown link source"; |
| 622 } | 624 } |
| 623 | 625 |
| 624 Browser* browser = BrowserList::GetLastActiveWithProfile(profile_); | 626 Browser* browser = browser::FindLastActiveWithProfile(profile_); |
| 625 OpenURLParams params( | 627 OpenURLParams params( |
| 626 url, Referrer(), NEW_WINDOW, content::PAGE_TRANSITION_LINK, false); | 628 url, Referrer(), NEW_WINDOW, content::PAGE_TRANSITION_LINK, false); |
| 627 browser->OpenURL(params); | 629 browser->OpenURL(params); |
| 628 } | 630 } |
| 629 | 631 |
| 630 #if defined(OS_WIN) && !defined(USE_AURA) | 632 #if defined(OS_WIN) && !defined(USE_AURA) |
| 631 //////////////////////////////////////////////////////////////////////////////// | 633 //////////////////////////////////////////////////////////////////////////////// |
| 632 // AboutChromeView, GoogleUpdateStatusListener implementation: | 634 // AboutChromeView, GoogleUpdateStatusListener implementation: |
| 633 | 635 |
| 634 void AboutChromeView::OnReportResults(GoogleUpdateUpgradeResult result, | 636 void AboutChromeView::OnReportResults(GoogleUpdateUpgradeResult result, |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 789 int height = error_label_->GetHeightForWidth( | 791 int height = error_label_->GetHeightForWidth( |
| 790 dialog_dimensions_.width() - (2 * views::kPanelHorizMargin)) + | 792 dialog_dimensions_.width() - (2 * views::kPanelHorizMargin)) + |
| 791 views::kRelatedControlVerticalSpacing; | 793 views::kRelatedControlVerticalSpacing; |
| 792 window_rect.set_height(window_rect.height() + height); | 794 window_rect.set_height(window_rect.height() + height); |
| 793 GetWidget()->SetBounds(window_rect); | 795 GetWidget()->SetBounds(window_rect); |
| 794 | 796 |
| 795 return height; | 797 return height; |
| 796 } | 798 } |
| 797 | 799 |
| 798 #endif | 800 #endif |
| OLD | NEW |