| 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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 const char kFieldTrialName[] = "GoogleNow"; | 388 const char kFieldTrialName[] = "GoogleNow"; |
| 389 std::string enable_prefix(kEnablePrefix); | 389 std::string enable_prefix(kEnablePrefix); |
| 390 std::string field_trial_result = | 390 std::string field_trial_result = |
| 391 base::FieldTrialList::FindFullName(kFieldTrialName); | 391 base::FieldTrialList::FindFullName(kFieldTrialName); |
| 392 | 392 |
| 393 bool enabled_via_field_trial = | 393 bool enabled_via_field_trial = |
| 394 field_trial_result.compare(0, enable_prefix.length(), enable_prefix) == 0; | 394 field_trial_result.compare(0, enable_prefix.length(), enable_prefix) == 0; |
| 395 | 395 |
| 396 // Enable the feature on trybots and trunk builds. | 396 // Enable the feature on trybots and trunk builds. |
| 397 bool enabled_via_trunk_build = | 397 bool enabled_via_trunk_build = |
| 398 chrome::VersionInfo::GetChannel() == chrome::VersionInfo::CHANNEL_UNKNOWN; | 398 chrome::VersionInfo::GetChannel() == version_info::Channel::UNKNOWN; |
| 399 | 399 |
| 400 bool is_authenticated = | 400 bool is_authenticated = |
| 401 SigninManagerFactory::GetForProfile(profile_)->IsAuthenticated(); | 401 SigninManagerFactory::GetForProfile(profile_)->IsAuthenticated(); |
| 402 | 402 |
| 403 bool enabled = | 403 bool enabled = |
| 404 (enabled_via_field_trial && is_authenticated) || enabled_via_trunk_build; | 404 (enabled_via_field_trial && is_authenticated) || enabled_via_trunk_build; |
| 405 | 405 |
| 406 #if defined(ENABLE_APP_LIST) && defined(OS_CHROMEOS) | 406 #if defined(ENABLE_APP_LIST) && defined(OS_CHROMEOS) |
| 407 // Don't load if newer trial is running (== new extension id is available). | 407 // Don't load if newer trial is running (== new extension id is available). |
| 408 std::string ignored_extension_id; | 408 std::string ignored_extension_id; |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 manifest.release(), | 769 manifest.release(), |
| 770 root_directory, | 770 root_directory, |
| 771 false); | 771 false); |
| 772 CHECK_EQ(extension_id, actual_extension_id); | 772 CHECK_EQ(extension_id, actual_extension_id); |
| 773 if (!done_cb.is_null()) | 773 if (!done_cb.is_null()) |
| 774 done_cb.Run(); | 774 done_cb.Run(); |
| 775 } | 775 } |
| 776 #endif | 776 #endif |
| 777 | 777 |
| 778 } // namespace extensions | 778 } // namespace extensions |
| OLD | NEW |