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/extensions/component_loader.h" | 5 #include "chrome/browser/extensions/component_loader.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 file_util::LoadManifest(root_directory, manifest_filename, &error)); | 102 file_util::LoadManifest(root_directory, manifest_filename, &error)); |
103 if (!manifest) { | 103 if (!manifest) { |
104 LOG(ERROR) << "Can't load " | 104 LOG(ERROR) << "Can't load " |
105 << root_directory.Append(manifest_filename).AsUTF8Unsafe() | 105 << root_directory.Append(manifest_filename).AsUTF8Unsafe() |
106 << ": " << error; | 106 << ": " << error; |
107 return nullptr; | 107 return nullptr; |
108 } | 108 } |
109 bool localized = extension_l10n_util::LocalizeExtension( | 109 bool localized = extension_l10n_util::LocalizeExtension( |
110 root_directory, manifest.get(), &error); | 110 root_directory, manifest.get(), &error); |
111 CHECK(localized) << error; | 111 CHECK(localized) << error; |
112 return manifest.Pass(); | 112 return manifest; |
113 } | 113 } |
114 | 114 |
115 bool IsNormalSession() { | 115 bool IsNormalSession() { |
116 return !base::CommandLine::ForCurrentProcess()->HasSwitch( | 116 return !base::CommandLine::ForCurrentProcess()->HasSwitch( |
117 chromeos::switches::kGuestSession) && | 117 chromeos::switches::kGuestSession) && |
118 user_manager::UserManager::IsInitialized() && | 118 user_manager::UserManager::IsInitialized() && |
119 user_manager::UserManager::Get()->IsUserLoggedIn(); | 119 user_manager::UserManager::Get()->IsUserLoggedIn(); |
120 } | 120 } |
121 #endif // defined(OS_CHROMEOS) | 121 #endif // defined(OS_CHROMEOS) |
122 | 122 |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 manifest.release(), | 767 manifest.release(), |
768 root_directory, | 768 root_directory, |
769 false); | 769 false); |
770 CHECK_EQ(extension_id, actual_extension_id); | 770 CHECK_EQ(extension_id, actual_extension_id); |
771 if (!done_cb.is_null()) | 771 if (!done_cb.is_null()) |
772 done_cb.Run(); | 772 done_cb.Run(); |
773 } | 773 } |
774 #endif | 774 #endif |
775 | 775 |
776 } // namespace extensions | 776 } // namespace extensions |
OLD | NEW |