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

Side by Side Diff: components/app_modal/views/javascript_app_modal_dialog_views.cc

Issue 1686433002: Remove DialogDelegate::OnClosed() which is redundant with (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 10 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 "components/app_modal/views/javascript_app_modal_dialog_views.h" 5 #include "components/app_modal/views/javascript_app_modal_dialog_views.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "components/app_modal/javascript_app_modal_dialog.h" 8 #include "components/app_modal/javascript_app_modal_dialog.h"
9 #include "components/constrained_window/constrained_window_views.h" 9 #include "components/constrained_window/constrained_window_views.h"
10 #include "grit/components_strings.h" 10 #include "grit/components_strings.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 parent_->OnCancel(message_box_view_->IsCheckBoxSelected()); 104 parent_->OnCancel(message_box_view_->IsCheckBoxSelected());
105 return true; 105 return true;
106 } 106 }
107 107
108 bool JavaScriptAppModalDialogViews::Accept() { 108 bool JavaScriptAppModalDialogViews::Accept() {
109 parent_->OnAccept(message_box_view_->GetInputText(), 109 parent_->OnAccept(message_box_view_->GetInputText(),
110 message_box_view_->IsCheckBoxSelected()); 110 message_box_view_->IsCheckBoxSelected());
111 return true; 111 return true;
112 } 112 }
113 113
114 void JavaScriptAppModalDialogViews::OnClosed() {
115 parent_->OnClose();
116 }
117
118 views::Widget* JavaScriptAppModalDialogViews::GetWidget() { 114 views::Widget* JavaScriptAppModalDialogViews::GetWidget() {
msw 2016/02/11 18:08:58 nit: reorder these GetWidget impls too, please.
Evan Stade 2016/02/11 20:02:11 Done.
119 return message_box_view_->GetWidget(); 115 return message_box_view_->GetWidget();
120 } 116 }
121 117
122 const views::Widget* JavaScriptAppModalDialogViews::GetWidget() const { 118 const views::Widget* JavaScriptAppModalDialogViews::GetWidget() const {
123 return message_box_view_->GetWidget(); 119 return message_box_view_->GetWidget();
124 } 120 }
125 121
126 base::string16 JavaScriptAppModalDialogViews::GetDialogButtonLabel( 122 base::string16 JavaScriptAppModalDialogViews::GetDialogButtonLabel(
127 ui::DialogButton button) const { 123 ui::DialogButton button) const {
128 if (parent_->is_before_unload_dialog()) { 124 if (parent_->is_before_unload_dialog()) {
(...skipping 22 matching lines...) Expand all
151 views::View* JavaScriptAppModalDialogViews::GetContentsView() { 147 views::View* JavaScriptAppModalDialogViews::GetContentsView() {
152 return message_box_view_; 148 return message_box_view_;
153 } 149 }
154 150
155 views::View* JavaScriptAppModalDialogViews::GetInitiallyFocusedView() { 151 views::View* JavaScriptAppModalDialogViews::GetInitiallyFocusedView() {
156 if (message_box_view_->text_box()) 152 if (message_box_view_->text_box())
157 return message_box_view_->text_box(); 153 return message_box_view_->text_box();
158 return views::DialogDelegate::GetInitiallyFocusedView(); 154 return views::DialogDelegate::GetInitiallyFocusedView();
159 } 155 }
160 156
157 void JavaScriptAppModalDialogViews::WindowClosing() {
158 parent_->OnClose();
159 }
160
161 } // namespace app_modal 161 } // namespace app_modal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698