Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: chrome/browser/ui/views/update_recommended_message_box.cc

Issue 2039273003: Cleanup: Remove VersionUpdater::RelaunchBrowser interface method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comment. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/grit/chromium_strings.h" 9 #include "chrome/grit/chromium_strings.h"
10 #include "chrome/grit/generated_resources.h" 10 #include "chrome/grit/generated_resources.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 l10n_util::GetStringFUTF16(IDS_UPDATE_RECOMMENDED, product_name)); 43 l10n_util::GetStringFUTF16(IDS_UPDATE_RECOMMENDED, product_name));
44 params.message_width = kDialogWidth; 44 params.message_width = kDialogWidth;
45 // Also deleted when the window closes. 45 // Also deleted when the window closes.
46 message_box_view_ = new views::MessageBoxView(params); 46 message_box_view_ = new views::MessageBoxView(params);
47 } 47 }
48 48
49 UpdateRecommendedMessageBox::~UpdateRecommendedMessageBox() { 49 UpdateRecommendedMessageBox::~UpdateRecommendedMessageBox() {
50 } 50 }
51 51
52 bool UpdateRecommendedMessageBox::Accept() { 52 bool UpdateRecommendedMessageBox::Accept() {
53 #if defined(OS_CHROMEOS) 53 chrome::AttemptRelaunch();
54 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart();
55 // If running the Chrome OS build, but we're not on the device, fall through
56 #endif
57 chrome::AttemptRestart();
58 return true; 54 return true;
59 } 55 }
60 56
61 base::string16 UpdateRecommendedMessageBox::GetDialogButtonLabel( 57 base::string16 UpdateRecommendedMessageBox::GetDialogButtonLabel(
62 ui::DialogButton button) const { 58 ui::DialogButton button) const {
63 return l10n_util::GetStringUTF16((button == ui::DIALOG_BUTTON_OK) ? 59 return l10n_util::GetStringUTF16((button == ui::DIALOG_BUTTON_OK) ?
64 IDS_RELAUNCH_AND_UPDATE : IDS_NOT_NOW); 60 IDS_RELAUNCH_AND_UPDATE : IDS_NOT_NOW);
65 } 61 }
66 62
67 bool UpdateRecommendedMessageBox::ShouldShowWindowTitle() const { 63 bool UpdateRecommendedMessageBox::ShouldShowWindowTitle() const {
(...skipping 20 matching lines...) Expand all
88 return message_box_view_; 84 return message_box_view_;
89 } 85 }
90 86
91 views::Widget* UpdateRecommendedMessageBox::GetWidget() { 87 views::Widget* UpdateRecommendedMessageBox::GetWidget() {
92 return message_box_view_->GetWidget(); 88 return message_box_view_->GetWidget();
93 } 89 }
94 90
95 const views::Widget* UpdateRecommendedMessageBox::GetWidget() const { 91 const views::Widget* UpdateRecommendedMessageBox::GetWidget() const {
96 return message_box_view_->GetWidget(); 92 return message_box_view_->GetWidget();
97 } 93 }
OLDNEW
« no previous file with comments | « chrome/browser/lifetime/application_lifetime.cc ('k') | chrome/browser/ui/webui/help/help_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698