| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 button, base::Bind(&GlobalErrorBubbleView::SizeToContents, | 150 button, base::Bind(&GlobalErrorBubbleView::SizeToContents, |
| 151 base::Unretained(this)))); | 151 base::Unretained(this)))); |
| 152 } | 152 } |
| 153 } | 153 } |
| 154 } | 154 } |
| 155 | 155 |
| 156 bool GlobalErrorBubbleView::ShouldShowCloseButton() const { | 156 bool GlobalErrorBubbleView::ShouldShowCloseButton() const { |
| 157 return error_ && error_->ShouldShowCloseButton(); | 157 return error_ && error_->ShouldShowCloseButton(); |
| 158 } | 158 } |
| 159 | 159 |
| 160 bool GlobalErrorBubbleView::ShouldDefaultButtonBeBlue() const { | |
| 161 return true; | |
| 162 } | |
| 163 | |
| 164 base::string16 GlobalErrorBubbleView::GetDialogButtonLabel( | 160 base::string16 GlobalErrorBubbleView::GetDialogButtonLabel( |
| 165 ui::DialogButton button) const { | 161 ui::DialogButton button) const { |
| 166 if (!error_) | 162 if (!error_) |
| 167 return base::string16(); | 163 return base::string16(); |
| 168 return button == ui::DIALOG_BUTTON_OK | 164 return button == ui::DIALOG_BUTTON_OK |
| 169 ? error_->GetBubbleViewAcceptButtonLabel() | 165 ? error_->GetBubbleViewAcceptButtonLabel() |
| 170 : error_->GetBubbleViewCancelButtonLabel(); | 166 : error_->GetBubbleViewCancelButtonLabel(); |
| 171 } | 167 } |
| 172 | 168 |
| 173 int GlobalErrorBubbleView::GetDialogButtons() const { | 169 int GlobalErrorBubbleView::GetDialogButtons() const { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 192 } | 188 } |
| 193 | 189 |
| 194 bool GlobalErrorBubbleView::Close() { | 190 bool GlobalErrorBubbleView::Close() { |
| 195 // Don't fall through to either Cancel() or Accept(). | 191 // Don't fall through to either Cancel() or Accept(). |
| 196 return true; | 192 return true; |
| 197 } | 193 } |
| 198 | 194 |
| 199 void GlobalErrorBubbleView::CloseBubbleView() { | 195 void GlobalErrorBubbleView::CloseBubbleView() { |
| 200 GetWidget()->Close(); | 196 GetWidget()->Close(); |
| 201 } | 197 } |
| OLD | NEW |