OLD | NEW |
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 "chrome/browser/ui/gtk/tab_modal_confirm_dialog_gtk.h" | 5 #include "chrome/browser/ui/gtk/tab_modal_confirm_dialog_gtk.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 delegate_->set_operations_delegate(this); | 104 delegate_->set_operations_delegate(this); |
105 | 105 |
106 WebContentsModalDialogManager* web_contents_modal_dialog_manager = | 106 WebContentsModalDialogManager* web_contents_modal_dialog_manager = |
107 WebContentsModalDialogManager::FromWebContents(web_contents); | 107 WebContentsModalDialogManager::FromWebContents(web_contents); |
108 web_contents_modal_dialog_manager->ShowDialog(window_); | 108 web_contents_modal_dialog_manager->ShowDialog(window_); |
109 } | 109 } |
110 | 110 |
111 TabModalConfirmDialogGtk::~TabModalConfirmDialogGtk() { | 111 TabModalConfirmDialogGtk::~TabModalConfirmDialogGtk() { |
112 // Provide a disposition in case the dialog was closed without accepting or | 112 // Provide a disposition in case the dialog was closed without accepting or |
113 // cancelling. | 113 // cancelling. |
114 delegate_->Cancel(); | 114 delegate_->Close(); |
115 | 115 |
116 gtk_widget_destroy(dialog_); | 116 gtk_widget_destroy(dialog_); |
117 } | 117 } |
118 | 118 |
119 void TabModalConfirmDialogGtk::AcceptTabModalDialog() { | 119 void TabModalConfirmDialogGtk::AcceptTabModalDialog() { |
120 OnAccept(NULL); | 120 OnAccept(NULL); |
121 } | 121 } |
122 | 122 |
123 void TabModalConfirmDialogGtk::CancelTabModalDialog() { | 123 void TabModalConfirmDialogGtk::CancelTabModalDialog() { |
124 OnCancel(NULL); | 124 OnCancel(NULL); |
(...skipping 18 matching lines...) Expand all Loading... |
143 delegate_->Cancel(); | 143 delegate_->Cancel(); |
144 } | 144 } |
145 | 145 |
146 void TabModalConfirmDialogGtk::OnLinkClicked(GtkWidget* widget) { | 146 void TabModalConfirmDialogGtk::OnLinkClicked(GtkWidget* widget) { |
147 delegate_->LinkClicked(event_utils::DispositionForCurrentButtonPressEvent()); | 147 delegate_->LinkClicked(event_utils::DispositionForCurrentButtonPressEvent()); |
148 } | 148 } |
149 | 149 |
150 void TabModalConfirmDialogGtk::OnDestroy(GtkWidget* widget) { | 150 void TabModalConfirmDialogGtk::OnDestroy(GtkWidget* widget) { |
151 delete this; | 151 delete this; |
152 } | 152 } |
OLD | NEW |