| 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 "ui/views/controls/webview/web_dialog_view.h" | 5 #include "ui/views/controls/webview/web_dialog_view.h" | 
| 6 | 6 | 
| 7 #include <vector> | 7 #include <vector> | 
| 8 | 8 | 
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" | 
| 10 #include "content/public/browser/browser_context.h" | 10 #include "content/public/browser/browser_context.h" | 
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 59 WebDialogView::~WebDialogView() { | 59 WebDialogView::~WebDialogView() { | 
| 60 } | 60 } | 
| 61 | 61 | 
| 62 content::WebContents* WebDialogView::web_contents() { | 62 content::WebContents* WebDialogView::web_contents() { | 
| 63   return web_view_->web_contents(); | 63   return web_view_->web_contents(); | 
| 64 } | 64 } | 
| 65 | 65 | 
| 66 //////////////////////////////////////////////////////////////////////////////// | 66 //////////////////////////////////////////////////////////////////////////////// | 
| 67 // WebDialogView, views::View implementation: | 67 // WebDialogView, views::View implementation: | 
| 68 | 68 | 
| 69 gfx::Size WebDialogView::GetPreferredSize() { | 69 gfx::Size WebDialogView::GetPreferredSize() const { | 
| 70   gfx::Size out; | 70   gfx::Size out; | 
| 71   if (delegate_) | 71   if (delegate_) | 
| 72     delegate_->GetDialogSize(&out); | 72     delegate_->GetDialogSize(&out); | 
| 73   return out; | 73   return out; | 
| 74 } | 74 } | 
| 75 | 75 | 
| 76 gfx::Size WebDialogView::GetMinimumSize() { | 76 gfx::Size WebDialogView::GetMinimumSize() const { | 
| 77   gfx::Size out; | 77   gfx::Size out; | 
| 78   if (delegate_) | 78   if (delegate_) | 
| 79     delegate_->GetMinimumDialogSize(&out); | 79     delegate_->GetMinimumDialogSize(&out); | 
| 80   return out; | 80   return out; | 
| 81 } | 81 } | 
| 82 | 82 | 
| 83 bool WebDialogView::AcceleratorPressed(const ui::Accelerator& accelerator) { | 83 bool WebDialogView::AcceleratorPressed(const ui::Accelerator& accelerator) { | 
| 84   // Pressing ESC closes the dialog. | 84   // Pressing ESC closes the dialog. | 
| 85   DCHECK_EQ(ui::VKEY_ESCAPE, accelerator.key_code()); | 85   DCHECK_EQ(ui::VKEY_ESCAPE, accelerator.key_code()); | 
| 86   if (GetWidget()) | 86   if (GetWidget()) | 
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 348   web_contents->SetDelegate(this); | 348   web_contents->SetDelegate(this); | 
| 349 | 349 | 
| 350   // Set the delegate. This must be done before loading the page. See | 350   // Set the delegate. This must be done before loading the page. See | 
| 351   // the comment above WebDialogUI in its header file for why. | 351   // the comment above WebDialogUI in its header file for why. | 
| 352   WebDialogUI::SetDelegate(web_contents, this); | 352   WebDialogUI::SetDelegate(web_contents, this); | 
| 353 | 353 | 
| 354   web_view_->LoadInitialURL(GetDialogContentURL()); | 354   web_view_->LoadInitialURL(GetDialogContentURL()); | 
| 355 } | 355 } | 
| 356 | 356 | 
| 357 }  // namespace views | 357 }  // namespace views | 
| OLD | NEW | 
|---|