OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_VIEW_SCREEN_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_VIEW_SCREEN_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_VIEW_SCREEN_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_VIEW_SCREEN_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "chrome/browser/chromeos/login/helper.h" | 10 #include "chrome/browser/chromeos/login/helper.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 // Refresh() is called after SetVisible(true) because screen handler | 138 // Refresh() is called after SetVisible(true) because screen handler |
139 // could exit right away. | 139 // could exit right away. |
140 Refresh(); | 140 Refresh(); |
141 } | 141 } |
142 | 142 |
143 template <class V> | 143 template <class V> |
144 void ViewScreen<V>::Hide() { | 144 void ViewScreen<V>::Hide() { |
145 if (view_) { | 145 if (view_) { |
146 delegate()->GetWizardView()->RemoveChildView(view_); | 146 delegate()->GetWizardView()->RemoveChildView(view_); |
147 // RemoveChildView doesn't delete the view and we also can't delete it here | 147 // RemoveChildView doesn't delete the view and we also can't delete it here |
148 // becuase we are in message processing for the view. | 148 // because we are in message processing for the view. |
149 MessageLoop::current()->DeleteSoon(FROM_HERE, view_); | 149 MessageLoop::current()->DeleteSoon(FROM_HERE, view_); |
150 view_ = NULL; | 150 view_ = NULL; |
151 } | 151 } |
152 } | 152 } |
153 | 153 |
154 /////////////////////////////////////////////////////////////////////////////// | 154 /////////////////////////////////////////////////////////////////////////////// |
155 // ViewScreen, protected: | 155 // ViewScreen, protected: |
156 template <class V> | 156 template <class V> |
157 void ViewScreen<V>::CreateView() { | 157 void ViewScreen<V>::CreateView() { |
158 view_ = AllocateView(); | 158 view_ = AllocateView(); |
159 view_->set_parent_owned(false); // ViewScreen owns the view. | 159 view_->set_parent_owned(false); // ViewScreen owns the view. |
160 delegate()->GetWizardView()->AddChildView(view_); | 160 delegate()->GetWizardView()->AddChildView(view_); |
161 view_->Init(); | 161 view_->Init(); |
162 view_->SetVisible(false); | 162 view_->SetVisible(false); |
163 } | 163 } |
164 | 164 |
165 } // namespace chromeos | 165 } // namespace chromeos |
166 | 166 |
167 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_VIEW_SCREEN_H_ | 167 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_VIEW_SCREEN_H_ |
OLD | NEW |