| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ash/test/child_modal_window.h" | 5 #include "ash/test/child_modal_window.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "ui/aura/window.h" | 8 #include "ui/aura/window.h" |
| 9 #include "ui/gfx/canvas.h" | 9 #include "ui/gfx/canvas.h" |
| 10 #include "ui/views/background.h" | 10 #include "ui/views/background.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 } | 55 } |
| 56 | 56 |
| 57 | 57 |
| 58 class ChildModalWindow : public views::WidgetDelegateView { | 58 class ChildModalWindow : public views::WidgetDelegateView { |
| 59 public: | 59 public: |
| 60 ChildModalWindow(); | 60 ChildModalWindow(); |
| 61 virtual ~ChildModalWindow(); | 61 virtual ~ChildModalWindow(); |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 // Overridden from View: | 64 // Overridden from View: |
| 65 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 65 virtual void OnPaint(gfx::Canvas* canvas) override; |
| 66 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 66 virtual gfx::Size GetPreferredSize() const override; |
| 67 | 67 |
| 68 // Overridden from WidgetDelegate: | 68 // Overridden from WidgetDelegate: |
| 69 virtual View* GetContentsView() OVERRIDE; | 69 virtual View* GetContentsView() override; |
| 70 virtual base::string16 GetWindowTitle() const OVERRIDE; | 70 virtual base::string16 GetWindowTitle() const override; |
| 71 virtual bool CanResize() const OVERRIDE; | 71 virtual bool CanResize() const override; |
| 72 virtual ui::ModalType GetModalType() const OVERRIDE; | 72 virtual ui::ModalType GetModalType() const override; |
| 73 | 73 |
| 74 DISALLOW_COPY_AND_ASSIGN(ChildModalWindow); | 74 DISALLOW_COPY_AND_ASSIGN(ChildModalWindow); |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 ChildModalWindow::ChildModalWindow() { | 77 ChildModalWindow::ChildModalWindow() { |
| 78 views::Textfield* textfield = new views::Textfield; | 78 views::Textfield* textfield = new views::Textfield; |
| 79 AddChildView(textfield); | 79 AddChildView(textfield); |
| 80 textfield->SetBounds( | 80 textfield->SetBounds( |
| 81 kChildTextfieldLeft, kChildTextfieldTop, | 81 kChildTextfieldLeft, kChildTextfieldTop, |
| 82 kChildTextfieldWidth, kChildTextfieldHeight); | 82 kChildTextfieldWidth, kChildTextfieldHeight); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 | 211 |
| 212 void ChildModalParent::OnWidgetDestroying(Widget* widget) { | 212 void ChildModalParent::OnWidgetDestroying(Widget* widget) { |
| 213 if (child_) { | 213 if (child_) { |
| 214 DCHECK_EQ(child_, widget); | 214 DCHECK_EQ(child_, widget); |
| 215 child_ = NULL; | 215 child_ = NULL; |
| 216 } | 216 } |
| 217 } | 217 } |
| 218 | 218 |
| 219 } // namespace test | 219 } // namespace test |
| 220 } // namespace ash | 220 } // namespace ash |
| OLD | NEW |