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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 } | 62 } |
63 | 63 |
64 last_size_ = bounds.size(); | 64 last_size_ = bounds.size(); |
65 } | 65 } |
66 | 66 |
67 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE { | 67 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE { |
68 should_quit_on_size_change_ = false; // No quit when we are closing. | 68 should_quit_on_size_change_ = false; // No quit when we are closing. |
69 HtmlDialogView::OnDialogClosed(json_retval); | 69 HtmlDialogView::OnDialogClosed(json_retval); |
70 } | 70 } |
71 | 71 |
72 virtual void OnTabMainFrameFirstRender() OVERRIDE { | 72 virtual void OnTabMainFrameRender() OVERRIDE { |
73 HtmlDialogView::OnTabMainFrameFirstRender(); | 73 HtmlDialogView::OnTabMainFrameRender(); |
74 painted_ = true; | 74 painted_ = true; |
75 MessageLoop::current()->Quit(); | 75 MessageLoop::current()->Quit(); |
76 } | 76 } |
77 | 77 |
78 // Whether first rendered notification is received. | 78 // Whether first rendered notification is received. |
79 bool painted_; | 79 bool painted_; |
80 | 80 |
81 // Whether we should quit message loop when size change is detected. | 81 // Whether we should quit message loop when size change is detected. |
82 bool should_quit_on_size_change_; | 82 bool should_quit_on_size_change_; |
83 gfx::Size last_size_; | 83 gfx::Size last_size_; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 new TestHtmlDialogView(browser()->profile(), browser(), delegate); | 193 new TestHtmlDialogView(browser()->profile(), browser(), delegate); |
194 WebContents* web_contents = browser()->GetSelectedWebContents(); | 194 WebContents* web_contents = browser()->GetSelectedWebContents(); |
195 ASSERT_TRUE(web_contents != NULL); | 195 ASSERT_TRUE(web_contents != NULL); |
196 views::Widget::CreateWindowWithParent( | 196 views::Widget::CreateWindowWithParent( |
197 html_view, web_contents->GetView()->GetTopLevelNativeWindow()); | 197 html_view, web_contents->GetView()->GetTopLevelNativeWindow()); |
198 EXPECT_TRUE(html_view->initialized_); | 198 EXPECT_TRUE(html_view->initialized_); |
199 | 199 |
200 html_view->InitDialog(); | 200 html_view->InitDialog(); |
201 html_view->GetWidget()->Show(); | 201 html_view->GetWidget()->Show(); |
202 | 202 |
203 // TestHtmlDialogView::OnTabMainFrameFirstRender() will Quit(). | 203 // TestHtmlDialogView::OnTabMainFrameRender() will Quit(). |
204 MessageLoopForUI::current()->Run(); | 204 MessageLoopForUI::current()->Run(); |
205 | 205 |
206 EXPECT_TRUE(html_view->painted()); | 206 EXPECT_TRUE(html_view->painted()); |
207 | 207 |
208 html_view->GetWidget()->Close(); | 208 html_view->GetWidget()->Close(); |
209 } | 209 } |
OLD | NEW |