| 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/update_recommended_message_box.h" | 5 #include "chrome/browser/ui/views/update_recommended_message_box.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/browser_list.h" | 7 #include "chrome/browser/ui/browser_list.h" |
| 8 #include "grit/chromium_strings.h" | 8 #include "grit/chromium_strings.h" |
| 9 #include "grit/generated_resources.h" | 9 #include "grit/generated_resources.h" |
| 10 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // UpdateRecommendedMessageBox, private: | 30 // UpdateRecommendedMessageBox, private: |
| 31 | 31 |
| 32 UpdateRecommendedMessageBox::UpdateRecommendedMessageBox() { | 32 UpdateRecommendedMessageBox::UpdateRecommendedMessageBox() { |
| 33 const int kDialogWidth = 400; | 33 const int kDialogWidth = 400; |
| 34 #if defined(OS_CHROMEOS) | 34 #if defined(OS_CHROMEOS) |
| 35 const int kProductNameID = IDS_PRODUCT_OS_NAME; | 35 const int kProductNameID = IDS_PRODUCT_OS_NAME; |
| 36 #else | 36 #else |
| 37 const int kProductNameID = IDS_PRODUCT_NAME; | 37 const int kProductNameID = IDS_PRODUCT_NAME; |
| 38 #endif | 38 #endif |
| 39 const string16 product_name = l10n_util::GetStringUTF16(kProductNameID); | 39 const string16 product_name = l10n_util::GetStringUTF16(kProductNameID); |
| 40 views::MessageBoxView::InitParams params( |
| 41 l10n_util::GetStringFUTF16(IDS_UPDATE_RECOMMENDED, product_name)); |
| 42 params.message_width = kDialogWidth; |
| 40 // Also deleted when the window closes. | 43 // Also deleted when the window closes. |
| 41 message_box_view_ = new views::MessageBoxView( | 44 message_box_view_ = new views::MessageBoxView(params); |
| 42 views::MessageBoxView::NO_OPTIONS, | |
| 43 l10n_util::GetStringFUTF16(IDS_UPDATE_RECOMMENDED, product_name), | |
| 44 string16(), | |
| 45 kDialogWidth); | |
| 46 } | 45 } |
| 47 | 46 |
| 48 UpdateRecommendedMessageBox::~UpdateRecommendedMessageBox() { | 47 UpdateRecommendedMessageBox::~UpdateRecommendedMessageBox() { |
| 49 } | 48 } |
| 50 | 49 |
| 51 bool UpdateRecommendedMessageBox::Accept() { | 50 bool UpdateRecommendedMessageBox::Accept() { |
| 52 #if defined(OS_CHROMEOS) | 51 #if defined(OS_CHROMEOS) |
| 53 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart(); | 52 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart(); |
| 54 // If running the Chrome OS build, but we're not on the device, fall through | 53 // If running the Chrome OS build, but we're not on the device, fall through |
| 55 #endif | 54 #endif |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 return message_box_view_; | 86 return message_box_view_; |
| 88 } | 87 } |
| 89 | 88 |
| 90 views::Widget* UpdateRecommendedMessageBox::GetWidget() { | 89 views::Widget* UpdateRecommendedMessageBox::GetWidget() { |
| 91 return message_box_view_->GetWidget(); | 90 return message_box_view_->GetWidget(); |
| 92 } | 91 } |
| 93 | 92 |
| 94 const views::Widget* UpdateRecommendedMessageBox::GetWidget() const { | 93 const views::Widget* UpdateRecommendedMessageBox::GetWidget() const { |
| 95 return message_box_view_->GetWidget(); | 94 return message_box_view_->GetWidget(); |
| 96 } | 95 } |
| OLD | NEW |