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/lifetime/application_lifetime.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" |
11 #include "ui/views/controls/message_box_view.h" | 11 #include "ui/views/controls/message_box_view.h" |
12 #include "ui/views/widget/widget.h" | 12 #include "ui/views/widget/widget.h" |
13 | 13 |
14 #if defined(OS_CHROMEOS) | 14 #if defined(OS_CHROMEOS) |
15 #include "chromeos/dbus/dbus_thread_manager.h" | 15 #include "chromeos/dbus/dbus_thread_manager.h" |
16 #include "chromeos/dbus/power_manager_client.h" | 16 #include "chromeos/dbus/power_manager_client.h" |
17 #endif | 17 #endif |
(...skipping 27 matching lines...) Expand all Loading... |
45 } | 45 } |
46 | 46 |
47 UpdateRecommendedMessageBox::~UpdateRecommendedMessageBox() { | 47 UpdateRecommendedMessageBox::~UpdateRecommendedMessageBox() { |
48 } | 48 } |
49 | 49 |
50 bool UpdateRecommendedMessageBox::Accept() { | 50 bool UpdateRecommendedMessageBox::Accept() { |
51 #if defined(OS_CHROMEOS) | 51 #if defined(OS_CHROMEOS) |
52 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart(); | 52 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart(); |
53 // 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 |
54 #endif | 54 #endif |
55 BrowserList::AttemptRestart(); | 55 browser::AttemptRestart(); |
56 return true; | 56 return true; |
57 } | 57 } |
58 | 58 |
59 string16 UpdateRecommendedMessageBox::GetDialogButtonLabel( | 59 string16 UpdateRecommendedMessageBox::GetDialogButtonLabel( |
60 ui::DialogButton button) const { | 60 ui::DialogButton button) const { |
61 return l10n_util::GetStringUTF16((button == ui::DIALOG_BUTTON_OK) ? | 61 return l10n_util::GetStringUTF16((button == ui::DIALOG_BUTTON_OK) ? |
62 IDS_RELAUNCH_AND_UPDATE : IDS_NOT_NOW); | 62 IDS_RELAUNCH_AND_UPDATE : IDS_NOT_NOW); |
63 } | 63 } |
64 | 64 |
65 bool UpdateRecommendedMessageBox::ShouldShowWindowTitle() const { | 65 bool UpdateRecommendedMessageBox::ShouldShowWindowTitle() const { |
(...skipping 20 matching lines...) Expand all Loading... |
86 return message_box_view_; | 86 return message_box_view_; |
87 } | 87 } |
88 | 88 |
89 views::Widget* UpdateRecommendedMessageBox::GetWidget() { | 89 views::Widget* UpdateRecommendedMessageBox::GetWidget() { |
90 return message_box_view_->GetWidget(); | 90 return message_box_view_->GetWidget(); |
91 } | 91 } |
92 | 92 |
93 const views::Widget* UpdateRecommendedMessageBox::GetWidget() const { | 93 const views::Widget* UpdateRecommendedMessageBox::GetWidget() const { |
94 return message_box_view_->GetWidget(); | 94 return message_box_view_->GetWidget(); |
95 } | 95 } |
OLD | NEW |