| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 WebDialogWebContentsDelegate(profile), | 57 WebDialogWebContentsDelegate(profile), |
| 58 initialized_(false), | 58 initialized_(false), |
| 59 delegate_(delegate), | 59 delegate_(delegate), |
| 60 dialog_controller_(new WebDialogController(this, profile, browser)), | 60 dialog_controller_(new WebDialogController(this, profile, browser)), |
| 61 web_view_(new views::WebView(profile)) { | 61 web_view_(new views::WebView(profile)) { |
| 62 web_view_->set_allow_accelerators(true); | 62 web_view_->set_allow_accelerators(true); |
| 63 AddChildView(web_view_); | 63 AddChildView(web_view_); |
| 64 set_contents_view(web_view_); | 64 set_contents_view(web_view_); |
| 65 SetLayoutManager(new views::FillLayout); | 65 SetLayoutManager(new views::FillLayout); |
| 66 // Pressing the ESC key will close the dialog. | 66 // Pressing the ESC key will close the dialog. |
| 67 AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE)); | 67 AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, |
| 68 ui::EF_NONE, |
| 69 ui::ET_KEY_PRESSED)); |
| 68 } | 70 } |
| 69 | 71 |
| 70 WebDialogView::~WebDialogView() { | 72 WebDialogView::~WebDialogView() { |
| 71 } | 73 } |
| 72 | 74 |
| 73 content::WebContents* WebDialogView::web_contents() { | 75 content::WebContents* WebDialogView::web_contents() { |
| 74 return web_view_->web_contents(); | 76 return web_view_->web_contents(); |
| 75 } | 77 } |
| 76 | 78 |
| 77 //////////////////////////////////////////////////////////////////////////////// | 79 //////////////////////////////////////////////////////////////////////////////// |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 | 329 |
| 328 if (delegate_) { | 330 if (delegate_) { |
| 329 gfx::Size out; | 331 gfx::Size out; |
| 330 delegate_->GetDialogSize(&out); | 332 delegate_->GetDialogSize(&out); |
| 331 if (!out.IsEmpty() && GetWidget()) | 333 if (!out.IsEmpty() && GetWidget()) |
| 332 GetWidget()->CenterWindow(out); | 334 GetWidget()->CenterWindow(out); |
| 333 } | 335 } |
| 334 | 336 |
| 335 web_view_->LoadInitialURL(GetDialogContentURL()); | 337 web_view_->LoadInitialURL(GetDialogContentURL()); |
| 336 } | 338 } |
| OLD | NEW |