| 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 "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "chrome/browser/lifetime/application_lifetime.h" | 8 #include "chrome/browser/lifetime/application_lifetime.h" |
| 9 #include "chrome/browser/ui/browser_dialogs.h" |
| 9 #include "chrome/grit/chromium_strings.h" | 10 #include "chrome/grit/chromium_strings.h" |
| 10 #include "components/constrained_window/constrained_window_views.h" | 11 #include "components/constrained_window/constrained_window_views.h" |
| 11 #include "components/strings/grit/components_strings.h" | 12 #include "components/strings/grit/components_strings.h" |
| 12 #include "ui/base/l10n/l10n_util.h" | 13 #include "ui/base/l10n/l10n_util.h" |
| 13 #include "ui/views/controls/message_box_view.h" | 14 #include "ui/views/controls/message_box_view.h" |
| 14 #include "ui/views/widget/widget.h" | 15 #include "ui/views/widget/widget.h" |
| 15 | 16 |
| 16 #if defined(OS_CHROMEOS) | 17 #if defined(OS_CHROMEOS) |
| 17 #include "chromeos/dbus/dbus_thread_manager.h" | 18 #include "chromeos/dbus/dbus_thread_manager.h" |
| 18 #include "chromeos/dbus/power_manager_client.h" | 19 #include "chromeos/dbus/power_manager_client.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 31 //////////////////////////////////////////////////////////////////////////////// | 32 //////////////////////////////////////////////////////////////////////////////// |
| 32 // UpdateRecommendedMessageBox, private: | 33 // UpdateRecommendedMessageBox, private: |
| 33 | 34 |
| 34 UpdateRecommendedMessageBox::UpdateRecommendedMessageBox() { | 35 UpdateRecommendedMessageBox::UpdateRecommendedMessageBox() { |
| 35 const int kDialogWidth = 400; | 36 const int kDialogWidth = 400; |
| 36 views::MessageBoxView::InitParams params( | 37 views::MessageBoxView::InitParams params( |
| 37 l10n_util::GetStringUTF16(IDS_UPDATE_RECOMMENDED)); | 38 l10n_util::GetStringUTF16(IDS_UPDATE_RECOMMENDED)); |
| 38 params.message_width = kDialogWidth; | 39 params.message_width = kDialogWidth; |
| 39 // Also deleted when the window closes. | 40 // Also deleted when the window closes. |
| 40 message_box_view_ = new views::MessageBoxView(params); | 41 message_box_view_ = new views::MessageBoxView(params); |
| 42 chrome::RecordDialogCreation(chrome::DialogIdentifier::UPDATE_RECOMMENDED); |
| 41 } | 43 } |
| 42 | 44 |
| 43 UpdateRecommendedMessageBox::~UpdateRecommendedMessageBox() { | 45 UpdateRecommendedMessageBox::~UpdateRecommendedMessageBox() { |
| 44 } | 46 } |
| 45 | 47 |
| 46 bool UpdateRecommendedMessageBox::Accept() { | 48 bool UpdateRecommendedMessageBox::Accept() { |
| 47 chrome::AttemptRelaunch(); | 49 chrome::AttemptRelaunch(); |
| 48 return true; | 50 return true; |
| 49 } | 51 } |
| 50 | 52 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 return message_box_view_; | 84 return message_box_view_; |
| 83 } | 85 } |
| 84 | 86 |
| 85 views::Widget* UpdateRecommendedMessageBox::GetWidget() { | 87 views::Widget* UpdateRecommendedMessageBox::GetWidget() { |
| 86 return message_box_view_->GetWidget(); | 88 return message_box_view_->GetWidget(); |
| 87 } | 89 } |
| 88 | 90 |
| 89 const views::Widget* UpdateRecommendedMessageBox::GetWidget() const { | 91 const views::Widget* UpdateRecommendedMessageBox::GetWidget() const { |
| 90 return message_box_view_->GetWidget(); | 92 return message_box_view_->GetWidget(); |
| 91 } | 93 } |
| OLD | NEW |