| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 window_ = CreateWebContentsModalDialogGtk(dialog_, cancel_); | 103 window_ = CreateWebContentsModalDialogGtk(dialog_, cancel_); |
| 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 |
| 113 // cancelling. |
| 114 delegate_->Cancel(); |
| 115 |
| 112 gtk_widget_destroy(dialog_); | 116 gtk_widget_destroy(dialog_); |
| 113 } | 117 } |
| 114 | 118 |
| 115 void TabModalConfirmDialogGtk::AcceptTabModalDialog() { | 119 void TabModalConfirmDialogGtk::AcceptTabModalDialog() { |
| 116 OnAccept(NULL); | 120 OnAccept(NULL); |
| 117 } | 121 } |
| 118 | 122 |
| 119 void TabModalConfirmDialogGtk::CancelTabModalDialog() { | 123 void TabModalConfirmDialogGtk::CancelTabModalDialog() { |
| 120 OnCancel(NULL); | 124 OnCancel(NULL); |
| 121 } | 125 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 139 delegate_->Cancel(); | 143 delegate_->Cancel(); |
| 140 } | 144 } |
| 141 | 145 |
| 142 void TabModalConfirmDialogGtk::OnLinkClicked(GtkWidget* widget) { | 146 void TabModalConfirmDialogGtk::OnLinkClicked(GtkWidget* widget) { |
| 143 delegate_->LinkClicked(event_utils::DispositionForCurrentButtonPressEvent()); | 147 delegate_->LinkClicked(event_utils::DispositionForCurrentButtonPressEvent()); |
| 144 } | 148 } |
| 145 | 149 |
| 146 void TabModalConfirmDialogGtk::OnDestroy(GtkWidget* widget) { | 150 void TabModalConfirmDialogGtk::OnDestroy(GtkWidget* widget) { |
| 147 delete this; | 151 delete this; |
| 148 } | 152 } |
| OLD | NEW |