OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 13 matching lines...) Expand all Loading... |
24 #include "views/widget/native_widget_gtk.h" | 24 #include "views/widget/native_widget_gtk.h" |
25 #endif | 25 #endif |
26 | 26 |
27 class RenderWidgetHost; | 27 class RenderWidgetHost; |
28 | 28 |
29 namespace browser { | 29 namespace browser { |
30 | 30 |
31 // Declared in browser_dialogs.h so that others don't need to depend on our .h. | 31 // Declared in browser_dialogs.h so that others don't need to depend on our .h. |
32 gfx::NativeWindow ShowHtmlDialog(gfx::NativeWindow parent, | 32 gfx::NativeWindow ShowHtmlDialog(gfx::NativeWindow parent, |
33 Profile* profile, | 33 Profile* profile, |
34 HtmlDialogUIDelegate* delegate) { | 34 HtmlDialogUIDelegate* delegate, |
| 35 DialogStyle style) { |
35 // It's not always safe to display an html dialog with an off the record | 36 // It's not always safe to display an html dialog with an off the record |
36 // profile. If the last browser with that profile is closed it will go | 37 // profile. If the last browser with that profile is closed it will go |
37 // away. | 38 // away. |
38 DCHECK(!profile->IsOffTheRecord() || delegate->IsDialogModal()); | 39 DCHECK(!profile->IsOffTheRecord() || delegate->IsDialogModal()); |
39 HtmlDialogView* html_view = new HtmlDialogView(profile, delegate); | 40 HtmlDialogView* html_view = new HtmlDialogView(profile, delegate); |
40 browser::CreateViewsWindow(parent, html_view); | 41 browser::CreateViewsWindow(parent, html_view, style); |
41 html_view->InitDialog(); | 42 html_view->InitDialog(); |
42 html_view->GetWidget()->Show(); | 43 html_view->GetWidget()->Show(); |
43 return html_view->GetWidget()->GetNativeWindow(); | 44 return html_view->GetWidget()->GetNativeWindow(); |
44 } | 45 } |
45 | 46 |
46 } // namespace browser | 47 } // namespace browser |
47 | 48 |
48 //////////////////////////////////////////////////////////////////////////////// | 49 //////////////////////////////////////////////////////////////////////////////// |
49 // HtmlDialogView, public: | 50 // HtmlDialogView, public: |
50 | 51 |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 } | 268 } |
268 | 269 |
269 void HtmlDialogView::OnTabMainFrameFirstRender() { | 270 void HtmlDialogView::OnTabMainFrameFirstRender() { |
270 #if defined(OS_CHROMEOS) && defined(TOOLKIT_USES_GTK) | 271 #if defined(OS_CHROMEOS) && defined(TOOLKIT_USES_GTK) |
271 if (initialized_) { | 272 if (initialized_) { |
272 views::NativeWidgetGtk::UpdateFreezeUpdatesProperty( | 273 views::NativeWidgetGtk::UpdateFreezeUpdatesProperty( |
273 GTK_WINDOW(GetWidget()->GetNativeView()), false); | 274 GTK_WINDOW(GetWidget()->GetNativeView()), false); |
274 } | 275 } |
275 #endif | 276 #endif |
276 } | 277 } |
OLD | NEW |