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

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

Issue 10378086: views: Add a new ctor to MessageBoxView that takes only a InitParams. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix review Created 8 years, 7 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 | Annotate | Revision Log
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 "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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tab_modal_confirm_dialog_views.cc ('k') | chrome/browser/ui/views/user_data_dir_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698