| 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 "ash/shell.h" | 5 #include "ash/shell.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 Shell::GetContainer(root_window, kShellWindowId_MouseCursorContainer)); | 88 Shell::GetContainer(root_window, kShellWindowId_MouseCursorContainer)); |
| 89 #endif | 89 #endif |
| 90 } | 90 } |
| 91 | 91 |
| 92 class ModalWindow : public views::WidgetDelegateView { | 92 class ModalWindow : public views::WidgetDelegateView { |
| 93 public: | 93 public: |
| 94 ModalWindow() {} | 94 ModalWindow() {} |
| 95 virtual ~ModalWindow() {} | 95 virtual ~ModalWindow() {} |
| 96 | 96 |
| 97 // Overridden from views::WidgetDelegate: | 97 // Overridden from views::WidgetDelegate: |
| 98 virtual views::View* GetContentsView() OVERRIDE { | 98 virtual views::View* GetContentsView() override { |
| 99 return this; | 99 return this; |
| 100 } | 100 } |
| 101 virtual bool CanResize() const OVERRIDE { | 101 virtual bool CanResize() const override { |
| 102 return true; | 102 return true; |
| 103 } | 103 } |
| 104 virtual base::string16 GetWindowTitle() const OVERRIDE { | 104 virtual base::string16 GetWindowTitle() const override { |
| 105 return base::ASCIIToUTF16("Modal Window"); | 105 return base::ASCIIToUTF16("Modal Window"); |
| 106 } | 106 } |
| 107 virtual ui::ModalType GetModalType() const OVERRIDE { | 107 virtual ui::ModalType GetModalType() const override { |
| 108 return ui::MODAL_TYPE_SYSTEM; | 108 return ui::MODAL_TYPE_SYSTEM; |
| 109 } | 109 } |
| 110 | 110 |
| 111 private: | 111 private: |
| 112 DISALLOW_COPY_AND_ASSIGN(ModalWindow); | 112 DISALLOW_COPY_AND_ASSIGN(ModalWindow); |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 class SimpleMenuDelegate : public ui::SimpleMenuModel::Delegate { | 115 class SimpleMenuDelegate : public ui::SimpleMenuModel::Delegate { |
| 116 public: | 116 public: |
| 117 SimpleMenuDelegate() {} | 117 SimpleMenuDelegate() {} |
| 118 virtual ~SimpleMenuDelegate() {} | 118 virtual ~SimpleMenuDelegate() {} |
| 119 | 119 |
| 120 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE { | 120 virtual bool IsCommandIdChecked(int command_id) const override { |
| 121 return false; | 121 return false; |
| 122 } | 122 } |
| 123 | 123 |
| 124 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE { | 124 virtual bool IsCommandIdEnabled(int command_id) const override { |
| 125 return true; | 125 return true; |
| 126 } | 126 } |
| 127 | 127 |
| 128 virtual bool GetAcceleratorForCommandId( | 128 virtual bool GetAcceleratorForCommandId( |
| 129 int command_id, | 129 int command_id, |
| 130 ui::Accelerator* accelerator) OVERRIDE { | 130 ui::Accelerator* accelerator) override { |
| 131 return false; | 131 return false; |
| 132 } | 132 } |
| 133 | 133 |
| 134 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE { | 134 virtual void ExecuteCommand(int command_id, int event_flags) override { |
| 135 } | 135 } |
| 136 | 136 |
| 137 private: | 137 private: |
| 138 DISALLOW_COPY_AND_ASSIGN(SimpleMenuDelegate); | 138 DISALLOW_COPY_AND_ASSIGN(SimpleMenuDelegate); |
| 139 }; | 139 }; |
| 140 | 140 |
| 141 } // namespace | 141 } // namespace |
| 142 | 142 |
| 143 class ShellTest : public test::AshTestBase { | 143 class ShellTest : public test::AshTestBase { |
| 144 public: | 144 public: |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 | 272 |
| 273 modal_widget->Close(); | 273 modal_widget->Close(); |
| 274 widget->Close(); | 274 widget->Close(); |
| 275 } | 275 } |
| 276 | 276 |
| 277 class TestModalDialogDelegate : public views::DialogDelegateView { | 277 class TestModalDialogDelegate : public views::DialogDelegateView { |
| 278 public: | 278 public: |
| 279 TestModalDialogDelegate() {} | 279 TestModalDialogDelegate() {} |
| 280 | 280 |
| 281 // Overridden from views::WidgetDelegate: | 281 // Overridden from views::WidgetDelegate: |
| 282 virtual ui::ModalType GetModalType() const OVERRIDE { | 282 virtual ui::ModalType GetModalType() const override { |
| 283 return ui::MODAL_TYPE_SYSTEM; | 283 return ui::MODAL_TYPE_SYSTEM; |
| 284 } | 284 } |
| 285 }; | 285 }; |
| 286 | 286 |
| 287 TEST_F(ShellTest, CreateLockScreenModalWindow) { | 287 TEST_F(ShellTest, CreateLockScreenModalWindow) { |
| 288 views::Widget::InitParams widget_params( | 288 views::Widget::InitParams widget_params( |
| 289 views::Widget::InitParams::TYPE_WINDOW); | 289 views::Widget::InitParams::TYPE_WINDOW); |
| 290 | 290 |
| 291 // Create a normal window. | 291 // Create a normal window. |
| 292 views::Widget* widget = CreateTestWindow(widget_params); | 292 views::Widget* widget = CreateTestWindow(widget_params); |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 private: | 533 private: |
| 534 DISALLOW_COPY_AND_ASSIGN(ShellTest2); | 534 DISALLOW_COPY_AND_ASSIGN(ShellTest2); |
| 535 }; | 535 }; |
| 536 | 536 |
| 537 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { | 537 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { |
| 538 window_.reset(new aura::Window(NULL)); | 538 window_.reset(new aura::Window(NULL)); |
| 539 window_->Init(aura::WINDOW_LAYER_NOT_DRAWN); | 539 window_->Init(aura::WINDOW_LAYER_NOT_DRAWN); |
| 540 } | 540 } |
| 541 | 541 |
| 542 } // namespace ash | 542 } // namespace ash |
| OLD | NEW |