| 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 "ui/base/ui_base_paths.h" | 5 #include "ui/base/ui_base_paths.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 !base::CreateDirectory(cur)) | 72 !base::CreateDirectory(cur)) |
| 73 return false; | 73 return false; |
| 74 | 74 |
| 75 *result = cur; | 75 *result = cur; |
| 76 return true; | 76 return true; |
| 77 } | 77 } |
| 78 | 78 |
| 79 // This cannot be done as a static initializer sadly since Visual Studio will | 79 // This cannot be done as a static initializer sadly since Visual Studio will |
| 80 // eliminate this object file if there is no direct entry point into it. | 80 // eliminate this object file if there is no direct entry point into it. |
| 81 void RegisterPathProvider() { | 81 void RegisterPathProvider() { |
| 82 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 82 static bool registered = false; |
| 83 if (!registered) { |
| 84 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
| 85 registered = true; |
| 86 } |
| 83 } | 87 } |
| 84 | 88 |
| 85 } // namespace ui | 89 } // namespace ui |
| OLD | NEW |