Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/toolbar/toolbar_actions_bar_bubble_views.h" | 5 #include "chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h" | 7 #include "chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h" |
| 8 #include "chrome/browser/ui/view_ids.h" | 8 #include "chrome/browser/ui/view_ids.h" |
| 9 #include "chrome/grit/locale_settings.h" | 9 #include "chrome/grit/locale_settings.h" |
| 10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 95 } | 95 } |
| 96 } | 96 } |
| 97 | 97 |
| 98 int ToolbarActionsBarBubbleViews::GetDialogButtons() const { | 98 int ToolbarActionsBarBubbleViews::GetDialogButtons() const { |
| 99 int buttons = ui::DIALOG_BUTTON_OK; | 99 int buttons = ui::DIALOG_BUTTON_OK; |
| 100 if (!delegate_->GetDismissButtonText().empty()) | 100 if (!delegate_->GetDismissButtonText().empty()) |
| 101 buttons |= ui::DIALOG_BUTTON_CANCEL; | 101 buttons |= ui::DIALOG_BUTTON_CANCEL; |
| 102 return buttons; | 102 return buttons; |
| 103 } | 103 } |
| 104 | 104 |
| 105 int ToolbarActionsBarBubbleViews::GetDefaultDialogButton() const { | |
| 106 return ui::DIALOG_BUTTON_NONE; | |
|
Peter Kasting
2016/06/17 19:14:41
Nit: May want a relevant TODO here
| |
| 107 } | |
| 108 | |
| 105 base::string16 ToolbarActionsBarBubbleViews::GetDialogButtonLabel( | 109 base::string16 ToolbarActionsBarBubbleViews::GetDialogButtonLabel( |
| 106 ui::DialogButton button) const { | 110 ui::DialogButton button) const { |
| 107 return button == ui::DIALOG_BUTTON_OK ? delegate_->GetActionButtonText() | 111 return button == ui::DIALOG_BUTTON_OK ? delegate_->GetActionButtonText() |
| 108 : delegate_->GetDismissButtonText(); | 112 : delegate_->GetDismissButtonText(); |
| 109 } | 113 } |
| 110 | 114 |
| 111 void ToolbarActionsBarBubbleViews::LinkClicked(views::Link* link, | 115 void ToolbarActionsBarBubbleViews::LinkClicked(views::Link* link, |
| 112 int event_flags) { | 116 int event_flags) { |
| 113 delegate_->OnBubbleClosed(ToolbarActionsBarBubbleDelegate::CLOSE_LEARN_MORE); | 117 delegate_->OnBubbleClosed(ToolbarActionsBarBubbleDelegate::CLOSE_LEARN_MORE); |
| 114 // Reset delegate so we don't send extra OnBubbleClosed()s. | 118 // Reset delegate so we don't send extra OnBubbleClosed()s. |
| 115 delegate_.reset(); | 119 delegate_.reset(); |
| 116 GetWidget()->Close(); | 120 GetWidget()->Close(); |
| 117 } | 121 } |
| OLD | NEW |