| 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/confirm_bubble_gtk.h" | 5 #include "chrome/browser/ui/gtk/confirm_bubble_gtk.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 } | 107 } |
| 108 | 108 |
| 109 void ShowBubble() { | 109 void ShowBubble() { |
| 110 model_deleted_ = false; | 110 model_deleted_ = false; |
| 111 accept_clicked_ = false; | 111 accept_clicked_ = false; |
| 112 cancel_clicked_ = false; | 112 cancel_clicked_ = false; |
| 113 link_clicked_ = false; | 113 link_clicked_ = false; |
| 114 | 114 |
| 115 gfx::Point point(0, 0); | 115 gfx::Point point(0, 0); |
| 116 bubble_ = new ConfirmBubbleGtk( | 116 bubble_ = new ConfirmBubbleGtk( |
| 117 GTK_WIDGET(browser()->window()->GetNativeHandle()), | 117 GTK_WIDGET(browser()->window()->GetNativeWindow()), |
| 118 point, | 118 point, |
| 119 new TestConfirmBubbleModel(&model_deleted_, | 119 new TestConfirmBubbleModel(&model_deleted_, |
| 120 &accept_clicked_, | 120 &accept_clicked_, |
| 121 &cancel_clicked_, | 121 &cancel_clicked_, |
| 122 &link_clicked_)); | 122 &link_clicked_)); |
| 123 bubble_->Show(); | 123 bubble_->Show(); |
| 124 } | 124 } |
| 125 | 125 |
| 126 ConfirmBubbleGtk* bubble() const { return bubble_; } | 126 ConfirmBubbleGtk* bubble() const { return bubble_; } |
| 127 | 127 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 173 |
| 174 IN_PROC_BROWSER_TEST_F(ConfirmBubbleGtkTest, ClickOk) { | 174 IN_PROC_BROWSER_TEST_F(ConfirmBubbleGtkTest, ClickOk) { |
| 175 ShowBubble(); | 175 ShowBubble(); |
| 176 bubble()->OnOkButton(NULL); | 176 bubble()->OnOkButton(NULL); |
| 177 | 177 |
| 178 EXPECT_TRUE(model_deleted()); | 178 EXPECT_TRUE(model_deleted()); |
| 179 EXPECT_TRUE(accept_clicked()); | 179 EXPECT_TRUE(accept_clicked()); |
| 180 EXPECT_FALSE(cancel_clicked()); | 180 EXPECT_FALSE(cancel_clicked()); |
| 181 EXPECT_FALSE(link_clicked()); | 181 EXPECT_FALSE(link_clicked()); |
| 182 } | 182 } |
| OLD | NEW |