| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/gtk/html_dialog_gtk.h" | 5 #include "chrome/browser/gtk/html_dialog_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_window.h" | 10 #include "chrome/browser/browser_window.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 Detach(); | 86 Detach(); |
| 87 if (delegate_) { | 87 if (delegate_) { |
| 88 HtmlDialogUIDelegate* dialog_delegate = delegate_; | 88 HtmlDialogUIDelegate* dialog_delegate = delegate_; |
| 89 delegate_ = NULL; // We will not communicate further with the delegate. | 89 delegate_ = NULL; // We will not communicate further with the delegate. |
| 90 dialog_delegate->OnDialogClosed(json_retval); | 90 dialog_delegate->OnDialogClosed(json_retval); |
| 91 } | 91 } |
| 92 gtk_widget_destroy(dialog_); | 92 gtk_widget_destroy(dialog_); |
| 93 delete this; | 93 delete this; |
| 94 } | 94 } |
| 95 | 95 |
| 96 bool HtmlDialogGtk::ShouldShowDialogTitle() const { |
| 97 return true; |
| 98 } |
| 99 |
| 96 //////////////////////////////////////////////////////////////////////////////// | 100 //////////////////////////////////////////////////////////////////////////////// |
| 97 // TabContentsDelegate implementation: | 101 // TabContentsDelegate implementation: |
| 98 | 102 |
| 99 void HtmlDialogGtk::MoveContents(TabContents* source, const gfx::Rect& pos) { | 103 void HtmlDialogGtk::MoveContents(TabContents* source, const gfx::Rect& pos) { |
| 100 // The contained web page wishes to resize itself. We let it do this because | 104 // The contained web page wishes to resize itself. We let it do this because |
| 101 // if it's a dialog we know about, we trust it not to be mean to the user. | 105 // if it's a dialog we know about, we trust it not to be mean to the user. |
| 102 } | 106 } |
| 103 | 107 |
| 104 void HtmlDialogGtk::ToolbarSizeChanged(TabContents* source, | 108 void HtmlDialogGtk::ToolbarSizeChanged(TabContents* source, |
| 105 bool is_animating) { | 109 bool is_animating) { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 gtk_widget_set_size_request(GTK_WIDGET(tab_contents_container_->widget()), | 162 gtk_widget_set_size_request(GTK_WIDGET(tab_contents_container_->widget()), |
| 159 dialog_size.width(), | 163 dialog_size.width(), |
| 160 dialog_size.height()); | 164 dialog_size.height()); |
| 161 | 165 |
| 162 gtk_widget_show_all(dialog_); | 166 gtk_widget_show_all(dialog_); |
| 163 } | 167 } |
| 164 | 168 |
| 165 void HtmlDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { | 169 void HtmlDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { |
| 166 OnDialogClosed(std::string()); | 170 OnDialogClosed(std::string()); |
| 167 } | 171 } |
| OLD | NEW |