| 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/views/html_dialog_view.h" | 5 #include "chrome/browser/ui/views/html_dialog_view.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 // Now Init the DOMView. This view runs in its own process to render the html. | 293 // Now Init the DOMView. This view runs in its own process to render the html. |
| 294 DOMView::Init(profile(), NULL); | 294 DOMView::Init(profile(), NULL); |
| 295 | 295 |
| 296 WebContents* web_contents = dom_contents_->web_contents(); | 296 WebContents* web_contents = dom_contents_->web_contents(); |
| 297 web_contents->SetDelegate(this); | 297 web_contents->SetDelegate(this); |
| 298 | 298 |
| 299 // Set the delegate. This must be done before loading the page. See | 299 // Set the delegate. This must be done before loading the page. See |
| 300 // the comment above HtmlDialogUI in its header file for why. | 300 // the comment above HtmlDialogUI in its header file for why. |
| 301 HtmlDialogUI::GetPropertyAccessor().SetProperty( | 301 HtmlDialogUI::GetPropertyAccessor().SetProperty( |
| 302 web_contents->GetPropertyBag(), this); | 302 web_contents->GetPropertyBag(), this); |
| 303 tab_watcher_.reset(new TabFirstRenderWatcher(web_contents, this)); | 303 tab_watcher_.reset(new TabRenderWatcher(web_contents, this)); |
| 304 | 304 |
| 305 DOMView::LoadURL(GetDialogContentURL()); | 305 DOMView::LoadURL(GetDialogContentURL()); |
| 306 } | 306 } |
| 307 | 307 |
| 308 void HtmlDialogView::RegisterDialogAccelerators() { | 308 void HtmlDialogView::RegisterDialogAccelerators() { |
| 309 // Pressing the ESC key will close the dialog. | 309 // Pressing the ESC key will close the dialog. |
| 310 AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, false, false, false)); | 310 AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, false, false, false)); |
| 311 } | 311 } |
| 312 | 312 |
| 313 void HtmlDialogView::OnRenderHostCreated(RenderViewHost* host) { | 313 void HtmlDialogView::OnRenderHostCreated(RenderViewHost* host) { |
| 314 } | 314 } |
| 315 | 315 |
| 316 void HtmlDialogView::OnTabMainFrameLoaded() { | 316 void HtmlDialogView::OnTabMainFrameLoaded() { |
| 317 } | 317 } |
| 318 | 318 |
| 319 void HtmlDialogView::OnTabMainFrameFirstRender() { | 319 void HtmlDialogView::OnTabMainFrameRender() { |
| 320 tab_watcher_.reset(); |
| 320 #if defined(OS_CHROMEOS) && defined(TOOLKIT_USES_GTK) | 321 #if defined(OS_CHROMEOS) && defined(TOOLKIT_USES_GTK) |
| 321 if (initialized_) { | 322 if (initialized_) { |
| 322 views::NativeWidgetGtk::UpdateFreezeUpdatesProperty( | 323 views::NativeWidgetGtk::UpdateFreezeUpdatesProperty( |
| 323 GTK_WINDOW(GetWidget()->GetNativeView()), false); | 324 GTK_WINDOW(GetWidget()->GetNativeView()), false); |
| 324 } | 325 } |
| 325 #endif | 326 #endif |
| 326 } | 327 } |
| OLD | NEW |