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

Side by Side Diff: chrome/browser/ui/views/payments/payment_request_dialog_view.cc

Issue 2785683003: views: implement width snapping for DialogDelegateViews (Closed)
Patch Set: Created 3 years, 8 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 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/payments/payment_request_dialog_view.h" 5 #include "chrome/browser/ui/views/payments/payment_request_dialog_view.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 void PaymentRequestDialogView::ShowInitialPaymentSheet() { 194 void PaymentRequestDialogView::ShowInitialPaymentSheet() {
195 view_stack_.Push(CreateViewAndInstallController( 195 view_stack_.Push(CreateViewAndInstallController(
196 base::MakeUnique<PaymentSheetViewController>( 196 base::MakeUnique<PaymentSheetViewController>(
197 request_->spec(), request_->state(), this), 197 request_->spec(), request_->state(), this),
198 &controller_map_), 198 &controller_map_),
199 /* animate = */ false); 199 /* animate = */ false);
200 if (observer_for_testing_) 200 if (observer_for_testing_)
201 observer_for_testing_->OnDialogOpened(); 201 observer_for_testing_->OnDialogOpened();
202 } 202 }
203 203
204 gfx::Size PaymentRequestDialogView::GetPreferredSize() const { 204 gfx::Size PaymentRequestDialogView::GetUnsnappedPreferredSize() const {
205 return gfx::Size(450, 450); 205 return gfx::Size(450, 450);
Peter Kasting 2017/03/30 00:35:35 Another case that needs a bug filed
206 } 206 }
207 207
208 void PaymentRequestDialogView::ViewHierarchyChanged( 208 void PaymentRequestDialogView::ViewHierarchyChanged(
209 const ViewHierarchyChangedDetails& details) { 209 const ViewHierarchyChangedDetails& details) {
210 if (being_closed_) 210 if (being_closed_)
211 return; 211 return;
212 212
213 // When a view that is associated with a controller is removed from this 213 // When a view that is associated with a controller is removed from this
214 // view's descendants, dispose of the controller. 214 // view's descendants, dispose of the controller.
215 if (!details.is_add && 215 if (!details.is_add &&
216 controller_map_.find(details.child) != controller_map_.end()) { 216 controller_map_.find(details.child) != controller_map_.end()) {
217 DCHECK(!details.move_view); 217 DCHECK(!details.move_view);
218 controller_map_.erase(details.child); 218 controller_map_.erase(details.child);
219 } 219 }
220 } 220 }
221 221
222 } // namespace payments 222 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698