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 11 matching lines...) Expand all Loading... |
22 | 22 |
23 #if defined(TOOLKIT_USES_GTK) | 23 #if defined(TOOLKIT_USES_GTK) |
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 #if defined(OS_CHROMEOS) |
| 33 gfx::NativeWindow ShowHtmlDialog(gfx::NativeWindow parent, |
| 34 Profile* profile, |
| 35 HtmlDialogUIDelegate* delegate, |
| 36 chromeos::BubbleWindowStyle style) { |
| 37 #else |
32 gfx::NativeWindow ShowHtmlDialog(gfx::NativeWindow parent, | 38 gfx::NativeWindow ShowHtmlDialog(gfx::NativeWindow parent, |
33 Profile* profile, | 39 Profile* profile, |
34 HtmlDialogUIDelegate* delegate) { | 40 HtmlDialogUIDelegate* delegate) { |
| 41 #endif |
35 // It's not always safe to display an html dialog with an off the record | 42 // 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 | 43 // profile. If the last browser with that profile is closed it will go |
37 // away. | 44 // away. |
38 DCHECK(!profile->IsOffTheRecord() || delegate->IsDialogModal()); | 45 DCHECK(!profile->IsOffTheRecord() || delegate->IsDialogModal()); |
39 HtmlDialogView* html_view = new HtmlDialogView(profile, delegate); | 46 HtmlDialogView* html_view = new HtmlDialogView(profile, delegate); |
| 47 #if defined(OS_CHROMEOS) |
| 48 browser::CreateViewsWindow(parent, html_view, style); |
| 49 #else |
40 browser::CreateViewsWindow(parent, html_view); | 50 browser::CreateViewsWindow(parent, html_view); |
| 51 #endif |
41 html_view->InitDialog(); | 52 html_view->InitDialog(); |
42 html_view->GetWidget()->Show(); | 53 html_view->GetWidget()->Show(); |
43 return html_view->GetWidget()->GetNativeWindow(); | 54 return html_view->GetWidget()->GetNativeWindow(); |
44 } | 55 } |
45 | 56 |
46 } // namespace browser | 57 } // namespace browser |
47 | 58 |
48 //////////////////////////////////////////////////////////////////////////////// | 59 //////////////////////////////////////////////////////////////////////////////// |
49 // HtmlDialogView, public: | 60 // HtmlDialogView, public: |
50 | 61 |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 } | 278 } |
268 | 279 |
269 void HtmlDialogView::OnTabMainFrameFirstRender() { | 280 void HtmlDialogView::OnTabMainFrameFirstRender() { |
270 #if defined(OS_CHROMEOS) && defined(TOOLKIT_USES_GTK) | 281 #if defined(OS_CHROMEOS) && defined(TOOLKIT_USES_GTK) |
271 if (initialized_) { | 282 if (initialized_) { |
272 views::NativeWidgetGtk::UpdateFreezeUpdatesProperty( | 283 views::NativeWidgetGtk::UpdateFreezeUpdatesProperty( |
273 GTK_WINDOW(GetWidget()->GetNativeView()), false); | 284 GTK_WINDOW(GetWidget()->GetNativeView()), false); |
274 } | 285 } |
275 #endif | 286 #endif |
276 } | 287 } |
OLD | NEW |