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

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

Issue 1759453002: Convert location bar bubble delegates to bubble dialog delegates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile errs Created 4 years, 9 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
« ui/views/view.cc ('K') | « ui/views/view.cc ('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 (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_client_view.h" 5 #include "ui/views/window/dialog_client_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "ui/events/keycodes/keyboard_codes.h" 10 #include "ui/events/keycodes/keyboard_codes.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 207
208 // Layout the contents view to the top and side edges of the contents bounds. 208 // Layout the contents view to the top and side edges of the contents bounds.
209 // NOTE: The local insets do not apply to the contents view sides or top. 209 // NOTE: The local insets do not apply to the contents view sides or top.
210 const gfx::Rect contents_bounds = GetContentsBounds(); 210 const gfx::Rect contents_bounds = GetContentsBounds();
211 contents_view()->SetBounds(contents_bounds.x(), contents_bounds.y(), 211 contents_view()->SetBounds(contents_bounds.x(), contents_bounds.y(),
212 contents_bounds.width(), bounds.bottom() - contents_bounds.y()); 212 contents_bounds.width(), bounds.bottom() - contents_bounds.y());
213 } 213 }
214 214
215 bool DialogClientView::AcceleratorPressed(const ui::Accelerator& accelerator) { 215 bool DialogClientView::AcceleratorPressed(const ui::Accelerator& accelerator) {
216 DCHECK_EQ(accelerator.key_code(), ui::VKEY_ESCAPE); 216 DCHECK_EQ(accelerator.key_code(), ui::VKEY_ESCAPE);
217 // Give the contents view a chance to handle it first.
218 if (contents_view()->HandlesAccelerator(accelerator) &&
219 contents_view()->AcceleratorPressed(accelerator)) {
msw 2016/03/03 23:01:40 Why not just call AcceleratorPressed and avoid the
Evan Stade 2016/03/04 04:12:08 because many views do something like AcceleratorP
msw 2016/03/04 18:21:08 Okay, good argument, I suppose I'm in favor of add
220 return true;
221 }
222
217 GetWidget()->Close(); 223 GetWidget()->Close();
218 return true; 224 return true;
219 } 225 }
220 226
221 void DialogClientView::ViewHierarchyChanged( 227 void DialogClientView::ViewHierarchyChanged(
222 const ViewHierarchyChangedDetails& details) { 228 const ViewHierarchyChangedDetails& details) {
223 ClientView::ViewHierarchyChanged(details); 229 ClientView::ViewHierarchyChanged(details);
224 if (details.is_add && details.child == this) { 230 if (details.is_add && details.child == this) {
225 UpdateDialogButtons(); 231 UpdateDialogButtons();
226 CreateExtraView(); 232 CreateExtraView();
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 child_views.end()); 366 child_views.end());
361 367
362 // Setup focus. 368 // Setup focus.
363 for (size_t i = 0; i < child_views.size(); i++) { 369 for (size_t i = 0; i < child_views.size(); i++) {
364 child_views[i]->SetNextFocusableView( 370 child_views[i]->SetNextFocusableView(
365 i + 1 != child_views.size() ? child_views[i + 1] : nullptr); 371 i + 1 != child_views.size() ? child_views[i + 1] : nullptr);
366 } 372 }
367 } 373 }
368 374
369 } // namespace views 375 } // namespace views
OLDNEW
« ui/views/view.cc ('K') | « ui/views/view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698