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 "base/keyboard_codes.h" | 7 #include "base/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 "views/widget/root_view.h" | 10 #include "views/widget/root_view.h" |
11 #include "views/widget/widget.h" | 11 #include "views/widget/widget.h" |
12 #include "views/window/window.h" | 12 #include "views/window/window.h" |
13 | 13 |
14 namespace browser { | 14 namespace browser { |
15 | 15 |
16 // Declared in browser_dialogs.h so that others don't need to depend on our .h. | 16 // Declared in browser_dialogs.h so that others don't need to depend on our .h. |
17 void ShowHtmlDialogView(gfx::NativeWindow parent, Browser* browser, | 17 void ShowHtmlDialogView(gfx::NativeWindow parent, Profile* profile, |
18 HtmlDialogUIDelegate* delegate) { | 18 HtmlDialogUIDelegate* delegate) { |
19 HtmlDialogView* html_view = | 19 HtmlDialogView* html_view = |
20 new HtmlDialogView(browser->profile(), delegate); | 20 new HtmlDialogView(profile, delegate); |
21 views::Window::CreateChromeWindow(parent, gfx::Rect(), html_view); | 21 views::Window::CreateChromeWindow(parent, gfx::Rect(), html_view); |
22 html_view->InitDialog(); | 22 html_view->InitDialog(); |
23 html_view->window()->Show(); | 23 html_view->window()->Show(); |
24 } | 24 } |
25 | 25 |
26 } // namespace browser | 26 } // namespace browser |
27 | 27 |
28 //////////////////////////////////////////////////////////////////////////////// | 28 //////////////////////////////////////////////////////////////////////////////// |
29 // HtmlDialogView, public: | 29 // HtmlDialogView, public: |
30 | 30 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 // Set the delegate. This must be done before loading the page. See | 174 // Set the delegate. This must be done before loading the page. See |
175 // the comment above HtmlDialogUI in its header file for why. | 175 // the comment above HtmlDialogUI in its header file for why. |
176 HtmlDialogUI::GetPropertyAccessor().SetProperty(tab_contents_->property_bag(), | 176 HtmlDialogUI::GetPropertyAccessor().SetProperty(tab_contents_->property_bag(), |
177 this); | 177 this); |
178 | 178 |
179 // Pressing the ESC key will close the dialog. | 179 // Pressing the ESC key will close the dialog. |
180 AddAccelerator(views::Accelerator(base::VKEY_ESCAPE, false, false, false)); | 180 AddAccelerator(views::Accelerator(base::VKEY_ESCAPE, false, false, false)); |
181 | 181 |
182 DOMView::LoadURL(GetDialogContentURL()); | 182 DOMView::LoadURL(GetDialogContentURL()); |
183 } | 183 } |
OLD | NEW |