Update code documentation for enum in EWK headers
[platform/framework/web/chromium-efl.git] / chrome / notification_helper / notification_helper_util.cc
1 // Copyright 2018 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/notification_helper/notification_helper_util.h"
6
7 #include "base/base_paths.h"
8 #include "base/files/file_util.h"
9 #include "base/path_service.h"
10 #include "chrome/common/chrome_constants.h"
11
12 namespace notification_helper {
13
14 base::FilePath GetChromeExePath() {
15   // Look for chrome.exe one folder above notification_helper.exe (as expected
16   // in Chrome installs). Failing that, look for it alonside
17   // notification_helper.exe.
18   base::FilePath dir_exe;
19   if (!base::PathService::Get(base::DIR_EXE, &dir_exe))
20     return base::FilePath();
21
22   base::FilePath chrome_exe =
23       dir_exe.DirName().Append(chrome::kBrowserProcessExecutableName);
24
25   if (!base::PathExists(chrome_exe)) {
26     chrome_exe = dir_exe.Append(chrome::kBrowserProcessExecutableName);
27     if (!base::PathExists(chrome_exe))
28       return base::FilePath();
29   }
30   return chrome_exe;
31 }
32
33 }  // namespace notification_helper