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

Side by Side Diff: ui/views/window/dialog_delegate.cc

Issue 2845593002: Updates Zoom bubble layout and adds +/- buttons (Closed)
Patch Set: Updates Zoom bubble layout and adds +/- buttons (comments) Created 3 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
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 "ui/views/window/dialog_delegate.h" 5 #include "ui/views/window/dialog_delegate.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 button->SetText(GetDialogButtonLabel(type)); 122 button->SetText(GetDialogButtonLabel(type));
123 button->SetEnabled(IsDialogButtonEnabled(type)); 123 button->SetEnabled(IsDialogButtonEnabled(type));
124 bool is_default = type == GetDefaultDialogButton(); 124 bool is_default = type == GetDefaultDialogButton();
125 if (!PlatformStyle::kDialogDefaultButtonCanBeCancel && 125 if (!PlatformStyle::kDialogDefaultButtonCanBeCancel &&
126 type == ui::DIALOG_BUTTON_CANCEL) { 126 type == ui::DIALOG_BUTTON_CANCEL) {
127 is_default = false; 127 is_default = false;
128 } 128 }
129 button->SetIsDefault(is_default); 129 button->SetIsDefault(is_default);
130 } 130 }
131 131
132 bool DialogDelegate::ShouldSnapFrameWidth() const {
133 return true;
134 }
135
132 int DialogDelegate::GetDialogButtons() const { 136 int DialogDelegate::GetDialogButtons() const {
133 return ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL; 137 return ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL;
134 } 138 }
135 139
136 int DialogDelegate::GetDefaultDialogButton() const { 140 int DialogDelegate::GetDefaultDialogButton() const {
137 if (GetDialogButtons() & ui::DIALOG_BUTTON_OK) 141 if (GetDialogButtons() & ui::DIALOG_BUTTON_OK)
138 return ui::DIALOG_BUTTON_OK; 142 return ui::DIALOG_BUTTON_OK;
139 if (GetDialogButtons() & ui::DIALOG_BUTTON_CANCEL) 143 if (GetDialogButtons() & ui::DIALOG_BUTTON_CANCEL)
140 return ui::DIALOG_BUTTON_CANCEL; 144 return ui::DIALOG_BUTTON_CANCEL;
141 return ui::DIALOG_BUTTON_NONE; 145 return ui::DIALOG_BUTTON_NONE;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 node_data->role = ui::AX_ROLE_DIALOG; 265 node_data->role = ui::AX_ROLE_DIALOG;
262 } 266 }
263 267
264 void DialogDelegateView::ViewHierarchyChanged( 268 void DialogDelegateView::ViewHierarchyChanged(
265 const ViewHierarchyChangedDetails& details) { 269 const ViewHierarchyChangedDetails& details) {
266 if (details.is_add && details.child == this && GetWidget()) 270 if (details.is_add && details.child == this && GetWidget())
267 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); 271 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true);
268 } 272 }
269 273
270 } // namespace views 274 } // namespace views
OLDNEW
« chrome/browser/ui/views/location_bar/zoom_bubble_view.cc ('K') | « ui/views/window/dialog_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698