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/chromeos/login/signin_screen_controller.h" | 5 #include "chrome/browser/chromeos/login/signin_screen_controller.h" |
6 | 6 |
7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
8 #include "chrome/browser/chromeos/login/lock/screen_locker.h" | 8 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
9 #include "chrome/browser/chromeos/login/lock/webui_screen_locker.h" | 9 #include "chrome/browser/chromeos/login/lock/webui_screen_locker.h" |
10 #include "chrome/browser/chromeos/login/screens/chrome_user_selection_screen.h" | 10 #include "chrome/browser/chromeos/login/screens/chrome_user_selection_screen.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 std::string display_type = oobe_ui->display_type(); | 27 std::string display_type = oobe_ui->display_type(); |
28 user_selection_screen_.reset(new ChromeUserSelectionScreen(display_type)); | 28 user_selection_screen_.reset(new ChromeUserSelectionScreen(display_type)); |
29 user_selection_screen_->SetLoginDisplayDelegate(login_display_delegate); | 29 user_selection_screen_->SetLoginDisplayDelegate(login_display_delegate); |
30 | 30 |
31 user_board_view_ = oobe_ui_->GetUserBoardScreenActor()->GetWeakPtr(); | 31 user_board_view_ = oobe_ui_->GetUserBoardScreenActor()->GetWeakPtr(); |
32 user_selection_screen_->SetView(user_board_view_.get()); | 32 user_selection_screen_->SetView(user_board_view_.get()); |
33 // TODO(jdufault): Bind and Unbind should be controlled by either the | 33 // TODO(jdufault): Bind and Unbind should be controlled by either the |
34 // Model/View which are then each responsible for automatically unbinding the | 34 // Model/View which are then each responsible for automatically unbinding the |
35 // other associated View/Model instance. Then we can eliminate this exposed | 35 // other associated View/Model instance. Then we can eliminate this exposed |
36 // WeakPtr logic. See crbug.com/685287. | 36 // WeakPtr logic. See crbug.com/685287. |
37 user_board_view_->Bind(*user_selection_screen_); | 37 user_board_view_->Bind(user_selection_screen_.get()); |
38 | 38 |
39 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, | 39 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, |
40 content::NotificationService::AllSources()); | 40 content::NotificationService::AllSources()); |
41 user_manager::UserManager::Get()->AddObserver(this); | 41 user_manager::UserManager::Get()->AddObserver(this); |
42 } | 42 } |
43 | 43 |
44 SignInScreenController::~SignInScreenController() { | 44 SignInScreenController::~SignInScreenController() { |
45 if (user_board_view_) | 45 if (user_board_view_) |
46 user_board_view_->Unbind(); | 46 user_board_view_->Unbind(); |
47 | 47 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 // Stop listening to any notification once session has started. | 104 // Stop listening to any notification once session has started. |
105 // Sign in screen objects are marked for deletion with DeleteSoon so | 105 // Sign in screen objects are marked for deletion with DeleteSoon so |
106 // make sure no object would be used after session has started. | 106 // make sure no object would be used after session has started. |
107 // http://crbug.com/125276 | 107 // http://crbug.com/125276 |
108 registrar_.RemoveAll(); | 108 registrar_.RemoveAll(); |
109 user_manager::UserManager::Get()->RemoveObserver(this); | 109 user_manager::UserManager::Get()->RemoveObserver(this); |
110 } | 110 } |
111 | 111 |
112 } // namespace chromeos | 112 } // namespace chromeos |
OLD | NEW |