| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/views/html_dialog_view.h" | 5 #include "chrome/browser/views/html_dialog_view.h" |
| 6 | 6 |
| 7 #include "app/keyboard_codes.h" | 7 #include "base/keyboard_codes.h" |
| 8 #include "chrome/browser/browser.h" | 8 #include "chrome/browser/browser.h" |
| 9 #include "chrome/browser/tab_contents/tab_contents.h" | 9 #include "chrome/browser/tab_contents/tab_contents.h" |
| 10 #include "chrome/common/native_web_keyboard_event.h" | 10 #include "chrome/common/native_web_keyboard_event.h" |
| 11 #include "views/widget/root_view.h" | 11 #include "views/widget/root_view.h" |
| 12 #include "views/widget/widget.h" | 12 #include "views/widget/widget.h" |
| 13 #include "views/window/window.h" | 13 #include "views/window/window.h" |
| 14 | 14 |
| 15 #if defined(OS_LINUX) | 15 #if defined(OS_LINUX) |
| 16 #include "views/window/window_gtk.h" | 16 #include "views/window/window_gtk.h" |
| 17 #endif | 17 #endif |
| (...skipping 30 matching lines...) Expand all Loading... |
| 48 | 48 |
| 49 gfx::Size HtmlDialogView::GetPreferredSize() { | 49 gfx::Size HtmlDialogView::GetPreferredSize() { |
| 50 gfx::Size out; | 50 gfx::Size out; |
| 51 if (delegate_) | 51 if (delegate_) |
| 52 delegate_->GetDialogSize(&out); | 52 delegate_->GetDialogSize(&out); |
| 53 return out; | 53 return out; |
| 54 } | 54 } |
| 55 | 55 |
| 56 bool HtmlDialogView::AcceleratorPressed(const views::Accelerator& accelerator) { | 56 bool HtmlDialogView::AcceleratorPressed(const views::Accelerator& accelerator) { |
| 57 // Pressing ESC closes the dialog. | 57 // Pressing ESC closes the dialog. |
| 58 DCHECK_EQ(app::VKEY_ESCAPE, accelerator.GetKeyCode()); | 58 DCHECK_EQ(base::VKEY_ESCAPE, accelerator.GetKeyCode()); |
| 59 OnDialogClosed(std::string()); | 59 OnDialogClosed(std::string()); |
| 60 return true; | 60 return true; |
| 61 } | 61 } |
| 62 | 62 |
| 63 //////////////////////////////////////////////////////////////////////////////// | 63 //////////////////////////////////////////////////////////////////////////////// |
| 64 // HtmlDialogView, views::WindowDelegate implementation: | 64 // HtmlDialogView, views::WindowDelegate implementation: |
| 65 | 65 |
| 66 bool HtmlDialogView::CanResize() const { | 66 bool HtmlDialogView::CanResize() const { |
| 67 return true; | 67 return true; |
| 68 } | 68 } |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 DOMView::Init(profile(), NULL); | 194 DOMView::Init(profile(), NULL); |
| 195 | 195 |
| 196 tab_contents_->set_delegate(this); | 196 tab_contents_->set_delegate(this); |
| 197 | 197 |
| 198 // Set the delegate. This must be done before loading the page. See | 198 // Set the delegate. This must be done before loading the page. See |
| 199 // the comment above HtmlDialogUI in its header file for why. | 199 // the comment above HtmlDialogUI in its header file for why. |
| 200 HtmlDialogUI::GetPropertyAccessor().SetProperty(tab_contents_->property_bag(), | 200 HtmlDialogUI::GetPropertyAccessor().SetProperty(tab_contents_->property_bag(), |
| 201 this); | 201 this); |
| 202 | 202 |
| 203 // Pressing the ESC key will close the dialog. | 203 // Pressing the ESC key will close the dialog. |
| 204 AddAccelerator(views::Accelerator(app::VKEY_ESCAPE, false, false, false)); | 204 AddAccelerator(views::Accelerator(base::VKEY_ESCAPE, false, false, false)); |
| 205 | 205 |
| 206 DOMView::LoadURL(GetDialogContentURL()); | 206 DOMView::LoadURL(GetDialogContentURL()); |
| 207 } | 207 } |
| OLD | NEW |