| 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/global_error_bubble_view.h" | 5 #include "chrome/browser/ui/views/global_error_bubble_view.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/ui/global_error/global_error.h" | 10 #include "chrome/browser/ui/global_error/global_error.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 views::Label* message_label = new views::Label(message_strings[i]); | 85 views::Label* message_label = new views::Label(message_strings[i]); |
| 86 message_label->SetMultiLine(true); | 86 message_label->SetMultiLine(true); |
| 87 message_label->SizeToFit(kMaxBubbleViewWidth); | 87 message_label->SizeToFit(kMaxBubbleViewWidth); |
| 88 message_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 88 message_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 89 message_labels.push_back(message_label); | 89 message_labels.push_back(message_label); |
| 90 } | 90 } |
| 91 | 91 |
| 92 base::string16 accept_string(error_->GetBubbleViewAcceptButtonLabel()); | 92 base::string16 accept_string(error_->GetBubbleViewAcceptButtonLabel()); |
| 93 scoped_ptr<views::BlueButton> accept_button( | 93 scoped_ptr<views::BlueButton> accept_button( |
| 94 new views::BlueButton(this, accept_string)); | 94 new views::BlueButton(this, accept_string)); |
| 95 accept_button->SetStyle(views::Button::STYLE_BUTTON); | |
| 96 accept_button->SetIsDefault(true); | 95 accept_button->SetIsDefault(true); |
| 97 accept_button->set_tag(TAG_ACCEPT_BUTTON); | 96 accept_button->set_tag(TAG_ACCEPT_BUTTON); |
| 98 | 97 |
| 99 if (error_->ShouldAddElevationIconToAcceptButton()) | 98 if (error_->ShouldAddElevationIconToAcceptButton()) |
| 100 elevation_icon_setter_.reset( | 99 elevation_icon_setter_.reset( |
| 101 new ElevationIconSetter( | 100 new ElevationIconSetter( |
| 102 accept_button.get(), | 101 accept_button.get(), |
| 103 base::Bind(&GlobalErrorBubbleView::SizeToContents, | 102 base::Bind(&GlobalErrorBubbleView::SizeToContents, |
| 104 base::Unretained(this)))); | 103 base::Unretained(this)))); |
| 105 | 104 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 error_->BubbleViewDidClose(browser_); | 190 error_->BubbleViewDidClose(browser_); |
| 192 } | 191 } |
| 193 | 192 |
| 194 bool GlobalErrorBubbleView::ShouldShowCloseButton() const { | 193 bool GlobalErrorBubbleView::ShouldShowCloseButton() const { |
| 195 return error_ && error_->ShouldShowCloseButton(); | 194 return error_ && error_->ShouldShowCloseButton(); |
| 196 } | 195 } |
| 197 | 196 |
| 198 void GlobalErrorBubbleView::CloseBubbleView() { | 197 void GlobalErrorBubbleView::CloseBubbleView() { |
| 199 GetWidget()->Close(); | 198 GetWidget()->Close(); |
| 200 } | 199 } |
| OLD | NEW |