| 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/ui/webui/chromeos/login/oobe_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 // Filter handler of chrome://oobe data source. | 73 // Filter handler of chrome://oobe data source. |
| 74 bool HandleRequestCallback( | 74 bool HandleRequestCallback( |
| 75 const std::string& path, | 75 const std::string& path, |
| 76 const content::WebUIDataSource::GotDataCallback& callback) { | 76 const content::WebUIDataSource::GotDataCallback& callback) { |
| 77 if (UserManager::Get()->IsUserLoggedIn() && | 77 if (UserManager::Get()->IsUserLoggedIn() && |
| 78 !UserManager::Get()->IsLoggedInAsStub() && | 78 !UserManager::Get()->IsLoggedInAsStub() && |
| 79 !ScreenLocker::default_screen_locker()) { | 79 !ScreenLocker::default_screen_locker()) { |
| 80 scoped_refptr<base::RefCountedBytes> empty_bytes = | 80 scoped_refptr<base::RefCountedBytes> empty_bytes = |
| 81 new base::RefCountedBytes(); | 81 new base::RefCountedBytes(); |
| 82 callback.Run(empty_bytes); | 82 callback.Run(empty_bytes.get()); |
| 83 return true; | 83 return true; |
| 84 } | 84 } |
| 85 | 85 |
| 86 return false; | 86 return false; |
| 87 } | 87 } |
| 88 | 88 |
| 89 // Creates a WebUIDataSource for chrome://oobe | 89 // Creates a WebUIDataSource for chrome://oobe |
| 90 content::WebUIDataSource* CreateOobeUIDataSource( | 90 content::WebUIDataSource* CreateOobeUIDataSource( |
| 91 const base::DictionaryValue& localized_strings) { | 91 const base::DictionaryValue& localized_strings) { |
| 92 content::WebUIDataSource* source = | 92 content::WebUIDataSource* source = |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 void OobeUI::OnCurrentScreenChanged(const std::string& screen) { | 419 void OobeUI::OnCurrentScreenChanged(const std::string& screen) { |
| 420 if (screen_ids_.count(screen)) { | 420 if (screen_ids_.count(screen)) { |
| 421 current_screen_ = screen_ids_[screen]; | 421 current_screen_ = screen_ids_[screen]; |
| 422 } else { | 422 } else { |
| 423 NOTREACHED() << "Screen should be registered in InitializeScreenMaps()"; | 423 NOTREACHED() << "Screen should be registered in InitializeScreenMaps()"; |
| 424 current_screen_ = SCREEN_UNKNOWN; | 424 current_screen_ = SCREEN_UNKNOWN; |
| 425 } | 425 } |
| 426 } | 426 } |
| 427 | 427 |
| 428 } // namespace chromeos | 428 } // namespace chromeos |
| OLD | NEW |