diff options
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/chrome_process_filter.cc | 35 | ||||
-rw-r--r-- | chrome/common/chrome_process_filter.h | 30 | ||||
-rw-r--r-- | chrome/common/common.vcproj | 8 |
3 files changed, 0 insertions, 73 deletions
diff --git a/chrome/common/chrome_process_filter.cc b/chrome/common/chrome_process_filter.cc deleted file mode 100644 index 2b12d2d..0000000 --- a/chrome/common/chrome_process_filter.cc +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include <windows.h> - -#include "chrome/common/chrome_process_filter.h" - -#include "base/path_service.h" -#include "chrome/common/chrome_constants.h" -#include "chrome/common/chrome_paths.h" - -BrowserProcessFilter::BrowserProcessFilter(const std::wstring user_data_dir) - : browser_process_id_(0), - user_data_dir_(user_data_dir) { - // Find the message window (if any) for the current user data directory, - // and get its process ID. We'll only count browser processes that either - // have the same process ID or have that process ID as their parent. - - if (user_data_dir_.length() == 0) - PathService::Get(chrome::DIR_USER_DATA, &user_data_dir_); - - - HWND message_window = FindWindowEx(HWND_MESSAGE, NULL, - chrome::kMessageWindowClass, - user_data_dir_.c_str()); - if (message_window) - GetWindowThreadProcessId(message_window, &browser_process_id_); -} - -bool BrowserProcessFilter::Includes(base::ProcessId pid, - base::ProcessId parent_pid) const { - return browser_process_id_ && (browser_process_id_ == pid || - browser_process_id_ == parent_pid); -} diff --git a/chrome/common/chrome_process_filter.h b/chrome/common/chrome_process_filter.h deleted file mode 100644 index 8421fce..0000000 --- a/chrome/common/chrome_process_filter.h +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_COMMON_CHROME_PROCESS_FILTER_H__ -#define CHROME_COMMON_CHROME_PROCESS_FILTER_H__ - -#include "base/process_util.h" - -// Filter all chrome browser processes that run with the same user data -// directory. -class BrowserProcessFilter : public base::ProcessFilter { - public: - // Create the filter for the given user_data_dir. - // If user_data_dir is an empty string, will use the PathService - // user_data_dir (e.g. chrome::DIR_USER_DATA). - explicit BrowserProcessFilter(const std::wstring user_data_dir); - - uint32 browser_process_id() const { return browser_process_id_; } - - virtual bool Includes(base::ProcessId pid, base::ProcessId parent_pid) const; - - private: - std::wstring user_data_dir_; - DWORD browser_process_id_; - - DISALLOW_EVIL_CONSTRUCTORS(BrowserProcessFilter); -}; - -#endif // CHROME_COMMON_CHROME_PROCESS_FILTER_H__ diff --git a/chrome/common/common.vcproj b/chrome/common/common.vcproj index a5ec901..5a26a5e 100644 --- a/chrome/common/common.vcproj +++ b/chrome/common/common.vcproj @@ -454,14 +454,6 @@ > </File> <File - RelativePath=".\chrome_process_filter.cc" - > - </File> - <File - RelativePath=".\chrome_process_filter.h" - > - </File> - <File RelativePath=".\chrome_switches.cc" > </File> |