Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: ash/shell_unittest.cc

Issue 2390953004: WidgetDelegateView is its own contents view. (Closed)
Patch Set: another minor fix Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/common/session/session_state_delegate.h" 10 #include "ash/common/session/session_state_delegate.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 Shell::GetContainer(root_window, kShellWindowId_MouseCursorContainer)); 89 Shell::GetContainer(root_window, kShellWindowId_MouseCursorContainer));
90 #endif 90 #endif
91 } 91 }
92 92
93 class ModalWindow : public views::WidgetDelegateView { 93 class ModalWindow : public views::WidgetDelegateView {
94 public: 94 public:
95 ModalWindow() {} 95 ModalWindow() {}
96 ~ModalWindow() override {} 96 ~ModalWindow() override {}
97 97
98 // Overridden from views::WidgetDelegate: 98 // Overridden from views::WidgetDelegate:
99 views::View* GetContentsView() override { return this; }
100 bool CanResize() const override { return true; } 99 bool CanResize() const override { return true; }
101 base::string16 GetWindowTitle() const override { 100 base::string16 GetWindowTitle() const override {
102 return base::ASCIIToUTF16("Modal Window"); 101 return base::ASCIIToUTF16("Modal Window");
103 } 102 }
104 ui::ModalType GetModalType() const override { return ui::MODAL_TYPE_SYSTEM; } 103 ui::ModalType GetModalType() const override { return ui::MODAL_TYPE_SYSTEM; }
105 104
106 private: 105 private:
107 DISALLOW_COPY_AND_ASSIGN(ModalWindow); 106 DISALLOW_COPY_AND_ASSIGN(ModalWindow);
108 }; 107 };
109 108
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 private: 503 private:
505 DISALLOW_COPY_AND_ASSIGN(ShellTest2); 504 DISALLOW_COPY_AND_ASSIGN(ShellTest2);
506 }; 505 };
507 506
508 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { 507 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) {
509 window_.reset(new aura::Window(NULL)); 508 window_.reset(new aura::Window(NULL));
510 window_->Init(ui::LAYER_NOT_DRAWN); 509 window_->Init(ui::LAYER_NOT_DRAWN);
511 } 510 }
512 511
513 } // namespace ash 512 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698