| 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/app/main_dll_loader_win.h" | 5 #include "chrome/app/main_dll_loader_win.h" |
| 6 | 6 |
| 7 #include <windows.h> // NOLINT | 7 #include <windows.h> // NOLINT |
| 8 #include <shlwapi.h> // NOLINT | 8 #include <shlwapi.h> // NOLINT |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 void RecordDidRun(const base::FilePath& dll_path) { | 63 void RecordDidRun(const base::FilePath& dll_path) { |
| 64 GoogleUpdateSettings::UpdateDidRunState(true); | 64 GoogleUpdateSettings::UpdateDidRunState(true); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void ClearDidRun(const base::FilePath& dll_path) { | 67 void ClearDidRun(const base::FilePath& dll_path) { |
| 68 GoogleUpdateSettings::UpdateDidRunState(false); | 68 GoogleUpdateSettings::UpdateDidRunState(false); |
| 69 } | 69 } |
| 70 | 70 |
| 71 bool ProcessTypeUsesMainDll(const std::string& process_type) { | 71 bool ProcessTypeUsesMainDll(const std::string& process_type) { |
| 72 return process_type.empty() || process_type == switches::kServiceProcess; | 72 return process_type.empty() || |
| 73 process_type == switches::kCloudPrintServiceProcess; |
| 73 } | 74 } |
| 74 | 75 |
| 75 // Indicates whether a file can be opened using the same flags that | 76 // Indicates whether a file can be opened using the same flags that |
| 76 // ::LoadLibrary() uses to open modules. | 77 // ::LoadLibrary() uses to open modules. |
| 77 bool ModuleCanBeRead(const base::FilePath& file_path) { | 78 bool ModuleCanBeRead(const base::FilePath& file_path) { |
| 78 return base::File(file_path, base::File::FLAG_OPEN | base::File::FLAG_READ) | 79 return base::File(file_path, base::File::FLAG_OPEN | base::File::FLAG_READ) |
| 79 .IsValid(); | 80 .IsValid(); |
| 80 } | 81 } |
| 81 | 82 |
| 82 // Returns the full path to |module_name|. Both dev builds (where |module_name| | 83 // Returns the full path to |module_name|. Both dev builds (where |module_name| |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 } | 282 } |
| 282 }; | 283 }; |
| 283 | 284 |
| 284 MainDllLoader* MakeMainDllLoader() { | 285 MainDllLoader* MakeMainDllLoader() { |
| 285 #if defined(GOOGLE_CHROME_BUILD) | 286 #if defined(GOOGLE_CHROME_BUILD) |
| 286 return new ChromeDllLoader(); | 287 return new ChromeDllLoader(); |
| 287 #else | 288 #else |
| 288 return new ChromiumDllLoader(); | 289 return new ChromiumDllLoader(); |
| 289 #endif | 290 #endif |
| 290 } | 291 } |
| OLD | NEW |