| 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/web_dialog_view.h" | 5 #include "chrome/browser/ui/views/web_dialog_view.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/property_bag.h" | 9 #include "base/property_bag.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "ui/views/widget/widget.h" | 24 #include "ui/views/widget/widget.h" |
| 25 | 25 |
| 26 #if defined(USE_AURA) | 26 #if defined(USE_AURA) |
| 27 #include "ui/aura/event.h" | 27 #include "ui/aura/event.h" |
| 28 #include "ui/views/widget/native_widget_aura.h" | 28 #include "ui/views/widget/native_widget_aura.h" |
| 29 #endif | 29 #endif |
| 30 | 30 |
| 31 using content::NativeWebKeyboardEvent; | 31 using content::NativeWebKeyboardEvent; |
| 32 using content::WebContents; | 32 using content::WebContents; |
| 33 using content::WebUIMessageHandler; | 33 using content::WebUIMessageHandler; |
| 34 using ui::WebDialogDelegate; |
| 35 using ui::WebDialogUI; |
| 34 | 36 |
| 35 namespace browser { | 37 namespace browser { |
| 36 | 38 |
| 37 // Declared in browser_dialogs.h so that others don't need to depend on our .h. | 39 // Declared in browser_dialogs.h so that others don't need to depend on our .h. |
| 38 gfx::NativeWindow ShowWebDialog(gfx::NativeWindow parent, | 40 gfx::NativeWindow ShowWebDialog(gfx::NativeWindow parent, |
| 39 Profile* profile, | 41 Profile* profile, |
| 40 Browser* browser, | 42 Browser* browser, |
| 41 WebDialogDelegate* delegate) { | 43 WebDialogDelegate* delegate) { |
| 42 views::Widget* widget = views::Widget::CreateWindowWithParent( | 44 views::Widget* widget = views::Widget::CreateWindowWithParent( |
| 43 new WebDialogView(profile, browser, delegate), parent); | 45 new WebDialogView(profile, browser, delegate), parent); |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 | 339 |
| 338 if (delegate_) { | 340 if (delegate_) { |
| 339 gfx::Size out; | 341 gfx::Size out; |
| 340 delegate_->GetDialogSize(&out); | 342 delegate_->GetDialogSize(&out); |
| 341 if (!out.IsEmpty() && GetWidget()) | 343 if (!out.IsEmpty() && GetWidget()) |
| 342 GetWidget()->CenterWindow(out); | 344 GetWidget()->CenterWindow(out); |
| 343 } | 345 } |
| 344 | 346 |
| 345 web_view_->LoadInitialURL(GetDialogContentURL()); | 347 web_view_->LoadInitialURL(GetDialogContentURL()); |
| 346 } | 348 } |
| OLD | NEW |