| 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/shell_integration.h" | 5 #include "chrome/browser/shell_integration.h" |
| 6 | 6 |
| 7 #include <cstdlib> | 7 #include <cstdlib> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 // Provides mock environment variables values based on a stored map. | 35 // Provides mock environment variables values based on a stored map. |
| 36 class MockEnvironment : public base::Environment { | 36 class MockEnvironment : public base::Environment { |
| 37 public: | 37 public: |
| 38 MockEnvironment() {} | 38 MockEnvironment() {} |
| 39 | 39 |
| 40 void Set(const std::string& name, const std::string& value) { | 40 void Set(const std::string& name, const std::string& value) { |
| 41 variables_[name] = value; | 41 variables_[name] = value; |
| 42 } | 42 } |
| 43 | 43 |
| 44 virtual bool GetVar(const char* variable_name, std::string* result) { | 44 virtual bool GetVar(const char* variable_name, std::string* result) OVERRIDE { |
| 45 if (ContainsKey(variables_, variable_name)) { | 45 if (ContainsKey(variables_, variable_name)) { |
| 46 *result = variables_[variable_name]; | 46 *result = variables_[variable_name]; |
| 47 return true; | 47 return true; |
| 48 } | 48 } |
| 49 | 49 |
| 50 return false; | 50 return false; |
| 51 } | 51 } |
| 52 | 52 |
| 53 virtual bool SetVar(const char* variable_name, const std::string& new_value) { | 53 virtual bool SetVar(const char* variable_name, |
| 54 const std::string& new_value) OVERRIDE { |
| 54 ADD_FAILURE(); | 55 ADD_FAILURE(); |
| 55 return false; | 56 return false; |
| 56 } | 57 } |
| 57 | 58 |
| 58 virtual bool UnSetVar(const char* variable_name) { | 59 virtual bool UnSetVar(const char* variable_name) OVERRIDE { |
| 59 ADD_FAILURE(); | 60 ADD_FAILURE(); |
| 60 return false; | 61 return false; |
| 61 } | 62 } |
| 62 | 63 |
| 63 private: | 64 private: |
| 64 std::map<std::string, std::string> variables_; | 65 std::map<std::string, std::string> variables_; |
| 65 | 66 |
| 66 DISALLOW_COPY_AND_ASSIGN(MockEnvironment); | 67 DISALLOW_COPY_AND_ASSIGN(MockEnvironment); |
| 67 }; | 68 }; |
| 68 | 69 |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 web_app::GenerateApplicationNameFromURL(GURL(test_cases[i].url)), | 408 web_app::GenerateApplicationNameFromURL(GURL(test_cases[i].url)), |
| 408 GURL(test_cases[i].url), | 409 GURL(test_cases[i].url), |
| 409 "", | 410 "", |
| 410 FilePath(), | 411 FilePath(), |
| 411 ASCIIToUTF16(test_cases[i].title), | 412 ASCIIToUTF16(test_cases[i].title), |
| 412 test_cases[i].icon_name, | 413 test_cases[i].icon_name, |
| 413 FilePath())); | 414 FilePath())); |
| 414 } | 415 } |
| 415 } | 416 } |
| 416 #endif | 417 #endif |
| OLD | NEW |