OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "mash/screenlock/screenlock.h" | 5 #include "mash/screenlock/screenlock.h" |
6 | 6 |
7 #include "ash/public/interfaces/container.mojom.h" | 7 #include "ash/public/interfaces/container.mojom.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "mash/session/public/interfaces/session.mojom.h" | 10 #include "mash/session/public/interfaces/session.mojom.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 : connector_(connector), | 29 : connector_(connector), |
30 unlock_button_( | 30 unlock_button_( |
31 views::MdTextButton::Create(this, base::ASCIIToUTF16("Unlock"))) { | 31 views::MdTextButton::Create(this, base::ASCIIToUTF16("Unlock"))) { |
32 set_background(views::Background::CreateSolidBackground(SK_ColorYELLOW)); | 32 set_background(views::Background::CreateSolidBackground(SK_ColorYELLOW)); |
33 AddChildView(unlock_button_); | 33 AddChildView(unlock_button_); |
34 } | 34 } |
35 ~ScreenlockView() override {} | 35 ~ScreenlockView() override {} |
36 | 36 |
37 private: | 37 private: |
38 // Overridden from views::WidgetDelegate: | 38 // Overridden from views::WidgetDelegate: |
39 views::View* GetContentsView() override { return this; } | |
40 base::string16 GetWindowTitle() const override { | 39 base::string16 GetWindowTitle() const override { |
41 // TODO(beng): use resources. | 40 // TODO(beng): use resources. |
42 return base::ASCIIToUTF16("Screenlock"); | 41 return base::ASCIIToUTF16("Screenlock"); |
43 } | 42 } |
44 | 43 |
45 // Overridden from views::View: | 44 // Overridden from views::View: |
46 void Layout() override { | 45 void Layout() override { |
47 gfx::Rect bounds = GetLocalBounds(); | 46 gfx::Rect bounds = GetLocalBounds(); |
48 bounds.Inset(10, 10); | 47 bounds.Inset(10, 10); |
49 | 48 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 widget->Show(); | 103 widget->Show(); |
105 } | 104 } |
106 | 105 |
107 void Screenlock::ScreenlockStateChanged(bool screen_locked) { | 106 void Screenlock::ScreenlockStateChanged(bool screen_locked) { |
108 if (!screen_locked) | 107 if (!screen_locked) |
109 base::MessageLoop::current()->QuitWhenIdle(); | 108 base::MessageLoop::current()->QuitWhenIdle(); |
110 } | 109 } |
111 | 110 |
112 } // namespace screenlock | 111 } // namespace screenlock |
113 } // namespace mash | 112 } // namespace mash |
OLD | NEW |