| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/test/chromedriver/chrome_launcher.h" | 5 #include "chrome/test/chromedriver/chrome_launcher.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 (*id)[i] = val + 'a'; | 531 (*id)[i] = val + 'a'; |
| 532 } else { | 532 } else { |
| 533 (*id)[i] = 'a'; | 533 (*id)[i] = 'a'; |
| 534 } | 534 } |
| 535 } | 535 } |
| 536 } | 536 } |
| 537 | 537 |
| 538 std::string GenerateExtensionId(const std::string& input) { | 538 std::string GenerateExtensionId(const std::string& input) { |
| 539 uint8 hash[16]; | 539 uint8 hash[16]; |
| 540 crypto::SHA256HashString(input, hash, sizeof(hash)); | 540 crypto::SHA256HashString(input, hash, sizeof(hash)); |
| 541 std::string output = StringToLowerASCII(base::HexEncode(hash, sizeof(hash))); | 541 std::string output = |
| 542 base::StringToLowerASCII(base::HexEncode(hash, sizeof(hash))); |
| 542 ConvertHexadecimalToIDAlphabet(&output); | 543 ConvertHexadecimalToIDAlphabet(&output); |
| 543 return output; | 544 return output; |
| 544 } | 545 } |
| 545 | 546 |
| 546 Status GetExtensionBackgroundPage(const base::DictionaryValue* manifest, | 547 Status GetExtensionBackgroundPage(const base::DictionaryValue* manifest, |
| 547 const std::string& id, | 548 const std::string& id, |
| 548 std::string* bg_page) { | 549 std::string* bg_page) { |
| 549 std::string bg_page_name; | 550 std::string bg_page_name; |
| 550 bool persistent = true; | 551 bool persistent = true; |
| 551 manifest->GetBoolean("background.persistent", &persistent); | 552 manifest->GetBoolean("background.persistent", &persistent); |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 // Write empty "First Run" file, otherwise Chrome will wipe the default | 788 // Write empty "First Run" file, otherwise Chrome will wipe the default |
| 788 // profile that was written. | 789 // profile that was written. |
| 789 if (base::WriteFile( | 790 if (base::WriteFile( |
| 790 user_data_dir.Append(chrome::kFirstRunSentinel), "", 0) != 0) { | 791 user_data_dir.Append(chrome::kFirstRunSentinel), "", 0) != 0) { |
| 791 return Status(kUnknownError, "failed to write first run file"); | 792 return Status(kUnknownError, "failed to write first run file"); |
| 792 } | 793 } |
| 793 return Status(kOk); | 794 return Status(kOk); |
| 794 } | 795 } |
| 795 | 796 |
| 796 } // namespace internal | 797 } // namespace internal |
| OLD | NEW |