| 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/constrained_window_views.h" | 5 #include "chrome/browser/ui/views/constrained_window_views.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/browser_commands.h" | 9 #include "chrome/browser/ui/browser_commands.h" |
| 10 #include "chrome/browser/ui/host_desktop.h" | 10 #include "chrome/browser/ui/host_desktop.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "base/win/windows_version.h" | 27 #include "base/win/windows_version.h" |
| 28 #endif | 28 #endif |
| 29 | 29 |
| 30 namespace { | 30 namespace { |
| 31 | 31 |
| 32 class TestDialog : public views::DialogDelegateView { | 32 class TestDialog : public views::DialogDelegateView { |
| 33 public: | 33 public: |
| 34 TestDialog() { SetFocusable(true); } | 34 TestDialog() { SetFocusable(true); } |
| 35 virtual ~TestDialog() {} | 35 virtual ~TestDialog() {} |
| 36 | 36 |
| 37 virtual views::View* GetInitiallyFocusedView() OVERRIDE { return this; } | 37 virtual views::View* GetInitiallyFocusedView() override { return this; } |
| 38 // Don't delete the delegate yet. Keep it around for inspection later. | 38 // Don't delete the delegate yet. Keep it around for inspection later. |
| 39 virtual void DeleteDelegate() OVERRIDE {} | 39 virtual void DeleteDelegate() override {} |
| 40 | 40 |
| 41 virtual ui::ModalType GetModalType() const OVERRIDE { | 41 virtual ui::ModalType GetModalType() const override { |
| 42 #if defined(USE_ASH) | 42 #if defined(USE_ASH) |
| 43 return ui::MODAL_TYPE_CHILD; | 43 return ui::MODAL_TYPE_CHILD; |
| 44 #else | 44 #else |
| 45 return views::WidgetDelegate::GetModalType(); | 45 return views::WidgetDelegate::GetModalType(); |
| 46 #endif | 46 #endif |
| 47 } | 47 } |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 DISALLOW_COPY_AND_ASSIGN(TestDialog); | 50 DISALLOW_COPY_AND_ASSIGN(TestDialog); |
| 51 }; | 51 }; |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 #endif | 207 #endif |
| 208 | 208 |
| 209 scoped_ptr<TestDialog> dialog = ShowModalDialog( | 209 scoped_ptr<TestDialog> dialog = ShowModalDialog( |
| 210 browser()->tab_strip_model()->GetActiveWebContents()); | 210 browser()->tab_strip_model()->GetActiveWebContents()); |
| 211 EXPECT_TRUE(dialog->GetWidget()->IsVisible()); | 211 EXPECT_TRUE(dialog->GetWidget()->IsVisible()); |
| 212 EXPECT_TRUE(ui_test_utils::SendKeyPressSync(browser(), ui::VKEY_ESCAPE, | 212 EXPECT_TRUE(ui_test_utils::SendKeyPressSync(browser(), ui::VKEY_ESCAPE, |
| 213 false, false, false, false)); | 213 false, false, false, false)); |
| 214 content::RunAllPendingInMessageLoop(); | 214 content::RunAllPendingInMessageLoop(); |
| 215 EXPECT_EQ(NULL, dialog->GetWidget()); | 215 EXPECT_EQ(NULL, dialog->GetWidget()); |
| 216 } | 216 } |
| OLD | NEW |