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

Side by Side Diff: chrome/browser/ui/gtk/protocol_dialog_gtk.cc

Issue 14307023: chrome: Use base::MessageLoop. (Part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/protocol_dialog_gtk.h" 5 #include "chrome/browser/ui/gtk/protocol_dialog_gtk.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 24 matching lines...) Expand all
35 new ExternalProtocolDialogDelegate(url))); 35 new ExternalProtocolDialogDelegate(url)));
36 } 36 }
37 37
38 /////////////////////////////////////////////////////////////////////////////// 38 ///////////////////////////////////////////////////////////////////////////////
39 // ProtocolDialogGtk 39 // ProtocolDialogGtk
40 40
41 ProtocolDialogGtk::ProtocolDialogGtk( 41 ProtocolDialogGtk::ProtocolDialogGtk(
42 scoped_ptr<const ProtocolDialogDelegate> delegate) 42 scoped_ptr<const ProtocolDialogDelegate> delegate)
43 : delegate_(delegate.Pass()), 43 : delegate_(delegate.Pass()),
44 creation_time_(base::TimeTicks::Now()) { 44 creation_time_(base::TimeTicks::Now()) {
45 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); 45 DCHECK_EQ(base::MessageLoop::TYPE_UI, base::MessageLoop::current()->type());
46 46
47 dialog_ = gtk_dialog_new_with_buttons( 47 dialog_ = gtk_dialog_new_with_buttons(
48 UTF16ToUTF8(delegate_->GetTitleText()).c_str(), 48 UTF16ToUTF8(delegate_->GetTitleText()).c_str(),
49 NULL, 49 NULL,
50 GTK_DIALOG_NO_SEPARATOR, 50 GTK_DIALOG_NO_SEPARATOR,
51 NULL); 51 NULL);
52 52
53 // Add the response buttons. 53 // Add the response buttons.
54 gtk_util::AddButtonToDialog(dialog_, 54 gtk_util::AddButtonToDialog(dialog_,
55 l10n_util::GetStringUTF8( 55 l10n_util::GetStringUTF8(
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 base::TimeTicks::Now() - creation_time_); 97 base::TimeTicks::Now() - creation_time_);
98 } else if (response_id == GTK_RESPONSE_REJECT) { 98 } else if (response_id == GTK_RESPONSE_REJECT) {
99 delegate_->DoCancel(delegate_->url(), checkbox); 99 delegate_->DoCancel(delegate_->url(), checkbox);
100 } 100 }
101 // If the response is GTK_RESPONSE_DELETE, triggered by the user closing 101 // If the response is GTK_RESPONSE_DELETE, triggered by the user closing
102 // the dialog, do nothing. 102 // the dialog, do nothing.
103 103
104 gtk_widget_destroy(dialog_); 104 gtk_widget_destroy(dialog_);
105 delete this; 105 delete this;
106 } 106 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/process_singleton_dialog.cc ('k') | chrome/browser/ui/gtk/reload_button_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698