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

Side by Side Diff: chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc

Issue 2084713002: Don't set a default action for ToolbarActionsBarBubbles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: 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
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 // TODO(estade): we should set a default where approprite. See
107 // http://crbug.com/621122
108 return ui::DIALOG_BUTTON_NONE;
109 }
110
105 base::string16 ToolbarActionsBarBubbleViews::GetDialogButtonLabel( 111 base::string16 ToolbarActionsBarBubbleViews::GetDialogButtonLabel(
106 ui::DialogButton button) const { 112 ui::DialogButton button) const {
107 return button == ui::DIALOG_BUTTON_OK ? delegate_->GetActionButtonText() 113 return button == ui::DIALOG_BUTTON_OK ? delegate_->GetActionButtonText()
108 : delegate_->GetDismissButtonText(); 114 : delegate_->GetDismissButtonText();
109 } 115 }
110 116
111 void ToolbarActionsBarBubbleViews::LinkClicked(views::Link* link, 117 void ToolbarActionsBarBubbleViews::LinkClicked(views::Link* link,
112 int event_flags) { 118 int event_flags) {
113 delegate_->OnBubbleClosed(ToolbarActionsBarBubbleDelegate::CLOSE_LEARN_MORE); 119 delegate_->OnBubbleClosed(ToolbarActionsBarBubbleDelegate::CLOSE_LEARN_MORE);
114 // Reset delegate so we don't send extra OnBubbleClosed()s. 120 // Reset delegate so we don't send extra OnBubbleClosed()s.
115 delegate_.reset(); 121 delegate_.reset();
116 GetWidget()->Close(); 122 GetWidget()->Close();
117 } 123 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698