| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/views/html_dialog_view.h" | 5 #include "chrome/browser/views/html_dialog_view.h" |
| 6 | 6 |
| 7 #include "app/keyboard_codes.h" | 7 #include "app/keyboard_codes.h" |
| 8 #include "chrome/browser/browser.h" | 8 #include "chrome/browser/browser.h" |
| 9 #include "chrome/browser/tab_contents/tab_contents.h" | 9 #include "chrome/browser/tab_contents/tab_contents.h" |
| 10 #include "chrome/browser/views/window.h" |
| 10 #include "chrome/common/native_web_keyboard_event.h" | 11 #include "chrome/common/native_web_keyboard_event.h" |
| 11 #include "views/widget/root_view.h" | 12 #include "views/widget/root_view.h" |
| 12 #include "views/widget/widget.h" | 13 #include "views/widget/widget.h" |
| 13 #include "views/window/window.h" | 14 #include "views/window/window.h" |
| 14 | 15 |
| 15 #if defined(OS_LINUX) | 16 #if defined(OS_LINUX) |
| 16 #include "views/window/window_gtk.h" | 17 #include "views/window/window_gtk.h" |
| 17 #endif | 18 #endif |
| 18 | 19 |
| 19 namespace browser { | 20 namespace browser { |
| 20 | 21 |
| 21 // Declared in browser_dialogs.h so that others don't need to depend on our .h. | 22 // Declared in browser_dialogs.h so that others don't need to depend on our .h. |
| 22 void ShowHtmlDialogView(gfx::NativeWindow parent, Profile* profile, | 23 void ShowHtmlDialogView(gfx::NativeWindow parent, Profile* profile, |
| 23 HtmlDialogUIDelegate* delegate) { | 24 HtmlDialogUIDelegate* delegate) { |
| 24 HtmlDialogView* html_view = | 25 HtmlDialogView* html_view = |
| 25 new HtmlDialogView(profile, delegate); | 26 new HtmlDialogView(profile, delegate); |
| 26 views::Window::CreateChromeWindow(parent, gfx::Rect(), html_view); | 27 browser::CreateViewsWindow(parent, gfx::Rect(), html_view); |
| 27 html_view->InitDialog(); | 28 html_view->InitDialog(); |
| 28 html_view->window()->Show(); | 29 html_view->window()->Show(); |
| 29 } | 30 } |
| 30 | 31 |
| 31 } // namespace browser | 32 } // namespace browser |
| 32 | 33 |
| 33 //////////////////////////////////////////////////////////////////////////////// | 34 //////////////////////////////////////////////////////////////////////////////// |
| 34 // HtmlDialogView, public: | 35 // HtmlDialogView, public: |
| 35 | 36 |
| 36 HtmlDialogView::HtmlDialogView(Profile* profile, | 37 HtmlDialogView::HtmlDialogView(Profile* profile, |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 // Set the delegate. This must be done before loading the page. See | 199 // Set the delegate. This must be done before loading the page. See |
| 199 // the comment above HtmlDialogUI in its header file for why. | 200 // the comment above HtmlDialogUI in its header file for why. |
| 200 HtmlDialogUI::GetPropertyAccessor().SetProperty(tab_contents_->property_bag(), | 201 HtmlDialogUI::GetPropertyAccessor().SetProperty(tab_contents_->property_bag(), |
| 201 this); | 202 this); |
| 202 | 203 |
| 203 // Pressing the ESC key will close the dialog. | 204 // Pressing the ESC key will close the dialog. |
| 204 AddAccelerator(views::Accelerator(app::VKEY_ESCAPE, false, false, false)); | 205 AddAccelerator(views::Accelerator(app::VKEY_ESCAPE, false, false, false)); |
| 205 | 206 |
| 206 DOMView::LoadURL(GetDialogContentURL()); | 207 DOMView::LoadURL(GetDialogContentURL()); |
| 207 } | 208 } |
| OLD | NEW |