diff options
45 files changed, 110 insertions, 107 deletions
diff --git a/app/win/scoped_prop.cc b/app/win/scoped_prop.cc index 203e1e4..8d48bc5 100644 --- a/app/win/scoped_prop.cc +++ b/app/win/scoped_prop.cc @@ -4,8 +4,6 @@ #include "app/win/scoped_prop.h" -#include "base/win_util.h" - namespace app { namespace win { diff --git a/app/win/shell.cc b/app/win/shell.cc index a3c7331..0f64f06 100644 --- a/app/win/shell.cc +++ b/app/win/shell.cc @@ -12,7 +12,7 @@ #include "base/string_util.h" #include "base/win/scoped_comptr.h" #include "base/win/windows_version.h" -#include "base/win_util.h" +#include "base/win/win_util.h" namespace app { namespace win { @@ -102,7 +102,7 @@ void SetAppIdForWindow(const string16& app_id, HWND hwnd) { HRESULT result = SHGetPropertyStoreForWindow( hwnd, __uuidof(*pps), reinterpret_cast<void**>(pps.Receive())); if (S_OK == result) - win_util::SetAppIdForPropertyStore(pps, app_id.c_str()); + base::win::SetAppIdForPropertyStore(pps, app_id.c_str()); // Cleanup. base::UnloadNativeLibrary(shell32_library); diff --git a/app/win_util.cc b/app/win_util.cc index 27a8235..3ed9842 100644 --- a/app/win_util.cc +++ b/app/win_util.cc @@ -19,9 +19,9 @@ #include "base/scoped_handle.h" #include "base/scoped_handle_win.h" #include "base/string_util.h" -#include "base/win_util.h" #include "base/win/scoped_gdi_object.h" #include "base/win/scoped_hdc.h" +#include "base/win/win_util.h" #include "gfx/codec/png_codec.h" #include "gfx/gdi_util.h" @@ -303,7 +303,7 @@ int MessageBox(HWND hwnd, gfx::Font GetWindowTitleFont() { NONCLIENTMETRICS ncm; - win_util::GetNonClientMetrics(&ncm); + base::win::GetNonClientMetrics(&ncm); l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); return gfx::Font(caption_font); diff --git a/base/base.gyp b/base/base.gyp index 1c82964..56f4e99 100644 --- a/base/base.gyp +++ b/base/base.gyp @@ -163,7 +163,6 @@ 'waitable_event_unittest.cc', 'waitable_event_watcher_unittest.cc', 'weak_ptr_unittest.cc', - 'win_util_unittest.cc', 'win/event_trace_consumer_unittest.cc', 'win/event_trace_controller_unittest.cc', 'win/event_trace_provider_unittest.cc', @@ -173,6 +172,7 @@ 'win/scoped_bstr_unittest.cc', 'win/scoped_comptr_unittest.cc', 'win/scoped_variant_unittest.cc', + 'win/win_util_unittest.cc', ], 'dependencies': [ 'base', diff --git a/base/base.gypi b/base/base.gypi index 7b6d50b..b73b6b1 100644 --- a/base/base.gypi +++ b/base/base.gypi @@ -317,10 +317,10 @@ 'win/scoped_hglobal.h', 'win/scoped_variant.cc', 'win/scoped_variant.h', + 'win/win_util.cc', + 'win/win_util.h', 'win/windows_version.cc', 'win/windows_version.h', - 'win_util.cc', - 'win_util.h', 'nix/xdg_util.h', 'nix/xdg_util.cc', ], diff --git a/base/file_util_win.cc b/base/file_util_win.cc index 2644803..c302d77 100644 --- a/base/file_util_win.cc +++ b/base/file_util_win.cc @@ -22,8 +22,8 @@ #include "base/thread_restrictions.h" #include "base/time.h" #include "base/utf_string_conversions.h" -#include "base/win_util.h" #include "base/win/scoped_comptr.h" +#include "base/win/win_util.h" #include "base/win/windows_version.h" namespace file_util { @@ -447,7 +447,7 @@ bool CreateShortcutLink(const wchar_t *source, const wchar_t *destination, if (FAILED(property_store.QueryFrom(i_shell_link))) return false; - if (!win_util::SetAppIdForPropertyStore(property_store, app_id)) + if (!base::win::SetAppIdForPropertyStore(property_store, app_id)) return false; } @@ -499,7 +499,7 @@ bool UpdateShortcutLink(const wchar_t *source, const wchar_t *destination, if (FAILED(property_store.QueryFrom(i_shell_link))) return false; - if (!win_util::SetAppIdForPropertyStore(property_store, app_id)) + if (!base::win::SetAppIdForPropertyStore(property_store, app_id)) return false; } diff --git a/base/linux_util.h b/base/linux_util.h index 0d2f20e..c1135ce 100644 --- a/base/linux_util.h +++ b/base/linux_util.h @@ -19,8 +19,7 @@ static const char kFindInodeSwitch[] = "--find-inode"; // in compromised context without going through the standard library. extern char g_linux_distro[]; -// Get the Linux Distro if we can, or return "Unknown", similar to -// GetWinVersion() in base/win_util.h. +// Get the Linux Distro if we can, or return "Unknown". std::string GetLinuxDistro(); // Set the Linux Distro string. diff --git a/base/win_util.cc b/base/win/win_util.cc index b7d5cd7..cce3d9c 100644 --- a/base/win_util.cc +++ b/base/win/win_util.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/win_util.h" +#include "base/win/win_util.h" #include <aclapi.h> #include <shobjidl.h> // Must be before propkey. @@ -20,7 +20,8 @@ #include "base/thread_restrictions.h" #include "base/win/windows_version.h" -namespace win_util { +namespace base { +namespace win { #define SIZEOF_STRUCT_WITH_SPECIFIED_LAST_MEMBER(struct_name, member) \ offsetof(struct_name, member) + \ @@ -135,7 +136,8 @@ bool RemoveCommandFromAutoRun(HKEY root_key, const string16& name) { return autorun_key.DeleteValue(name.c_str()); } -} // namespace win_util +} // namespace win +} // namespace base #ifdef _MSC_VER // diff --git a/base/win_util.h b/base/win/win_util.h index c06e9c7..187e42d 100644 --- a/base/win_util.h +++ b/base/win/win_util.h @@ -2,8 +2,25 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef BASE_WIN_UTIL_H_ -#define BASE_WIN_UTIL_H_ +// ============================================================================= +// PLEASE READ +// +// In general, you should not be adding stuff to this file. +// +// - If your thing is only used in one place, just put it in a reasonable +// location in or near that one place. It's nice you want people to be able +// to re-use your function, but realistically, if it hasn't been necessary +// before after so many years of development, it's probably not going to be +// used in other places in the future unless you know of them now. +// +// - If your thing is used by multiple callers and is UI-related, it should +// probably be in app/win/ instead. Try to put it in the most specific file +// possible (avoiding the *_util files when practical). +// +// ============================================================================= + +#ifndef BASE_WIN_WIN_UTIL_H_ +#define BASE_WIN_WIN_UTIL_H_ #pragma once #include <windows.h> @@ -16,7 +33,8 @@ struct IPropertyStore; struct _tagpropertykey; typedef _tagpropertykey PROPERTYKEY; -namespace win_util { +namespace base { +namespace win { void GetNonClientMetrics(NONCLIENTMETRICS* metrics); @@ -54,6 +72,7 @@ bool AddCommandToAutoRun(HKEY root_key, const string16& name, // could be HKCU or HKLM or the root of any user hive. bool RemoveCommandFromAutoRun(HKEY root_key, const string16& name); -} // namespace win_util +} // namespace win +} // namespace base -#endif // BASE_WIN_UTIL_H_ +#endif // BASE_WIN_WIN_UTIL_H_ diff --git a/base/win_util_unittest.cc b/base/win/win_util_unittest.cc index b0aeb8e..b79ed56 100644 --- a/base/win_util_unittest.cc +++ b/base/win/win_util_unittest.cc @@ -6,47 +6,53 @@ #include "base/basictypes.h" #include "base/string_util.h" -#include "base/win_util.h" +#include "base/win/win_util.h" #include "base/win/windows_version.h" #include "testing/gtest/include/gtest/gtest.h" +namespace base { +namespace win { + +namespace { + +// Saves the current thread's locale ID when initialized, and restores it when +// the instance is going out of scope. +class ThreadLocaleSaver { + public: + ThreadLocaleSaver() : original_locale_id_(GetThreadLocale()) {} + ~ThreadLocaleSaver() { SetThreadLocale(original_locale_id_); } + + private: + LCID original_locale_id_; + + DISALLOW_COPY_AND_ASSIGN(ThreadLocaleSaver); +}; + +} // namespace + // The test is somewhat silly, because the Vista bots some have UAC enabled // and some have it disabled. At least we check that it does not crash. TEST(BaseWinUtilTest, TestIsUACEnabled) { - if (base::win::GetVersion() >= base::win::VERSION_VISTA) { - win_util::UserAccountControlIsEnabled(); + if (GetVersion() >= base::win::VERSION_VISTA) { + UserAccountControlIsEnabled(); } else { - EXPECT_TRUE(win_util::UserAccountControlIsEnabled()); + EXPECT_TRUE(UserAccountControlIsEnabled()); } } TEST(BaseWinUtilTest, TestGetUserSidString) { std::wstring user_sid; - EXPECT_TRUE(win_util::GetUserSidString(&user_sid)); + EXPECT_TRUE(GetUserSidString(&user_sid)); EXPECT_TRUE(!user_sid.empty()); } TEST(BaseWinUtilTest, TestGetNonClientMetrics) { NONCLIENTMETRICS metrics = {0}; - win_util::GetNonClientMetrics(&metrics); + GetNonClientMetrics(&metrics); EXPECT_TRUE(metrics.cbSize > 0); EXPECT_TRUE(metrics.iScrollWidth > 0); EXPECT_TRUE(metrics.iScrollHeight > 0); } -namespace { - -// Saves the current thread's locale ID when initialized, and restores it when -// the instance is going out of scope. -class ThreadLocaleSaver { - public: - ThreadLocaleSaver() : original_locale_id_(GetThreadLocale()) {} - ~ThreadLocaleSaver() { SetThreadLocale(original_locale_id_); } - - private: - LCID original_locale_id_; - - DISALLOW_COPY_AND_ASSIGN(ThreadLocaleSaver); -}; - -} // namespace +} // namespace win +} // namespace base diff --git a/ceee/ie/broker/broker_rpc_server.cc b/ceee/ie/broker/broker_rpc_server.cc index 3adfd42..6f0a0f1 100644 --- a/ceee/ie/broker/broker_rpc_server.cc +++ b/ceee/ie/broker/broker_rpc_server.cc @@ -10,7 +10,6 @@ #include "base/logging.h" #include "base/metrics/histogram.h" #include "base/process_util.h" -#include "base/win_util.h" #include "broker_rpc_lib.h" // NOLINT #include "ceee/common/com_utils.h" #include "ceee/ie/broker/broker_module_util.h" diff --git a/ceee/ie/broker/broker_rpc_utils.cc b/ceee/ie/broker/broker_rpc_utils.cc index 1c99eea..27d4c0a 100644 --- a/ceee/ie/broker/broker_rpc_utils.cc +++ b/ceee/ie/broker/broker_rpc_utils.cc @@ -8,7 +8,7 @@ #include <algorithm> -#include "base/win_util.h" +#include "base/win/win_util.h" #include "ceee/common/process_utils_win.h" // Local interprocess communication only. @@ -24,7 +24,7 @@ std::wstring GetRpcEndpointAddress() { if (running_as_admin) endpoint += L"ADMIN-"; std::wstring sid; - win_util::GetUserSidString(&sid); + base::win::GetUserSidString(&sid); endpoint += sid; endpoint += L"-B4630D08-4621-41A1-A8D0-F1E98DA460D6"; // XP does not accept endpoints longer than 52. diff --git a/ceee/ie/plugin/bho/window_message_source.cc b/ceee/ie/plugin/bho/window_message_source.cc index 1ec5272..cd462d8 100644 --- a/ceee/ie/plugin/bho/window_message_source.cc +++ b/ceee/ie/plugin/bho/window_message_source.cc @@ -8,7 +8,6 @@ #include <algorithm> #include "base/logging.h" -#include "base/win_util.h" #include "ceee/common/window_utils.h" #include "ceee/common/windows_constants.h" #include "ceee/ie/common/ceee_module_util.h" diff --git a/chrome/app/breakpad_win.cc b/chrome/app/breakpad_win.cc index 017e61d..9f04967 100644 --- a/chrome/app/breakpad_win.cc +++ b/chrome/app/breakpad_win.cc @@ -20,8 +20,8 @@ #include "base/string_split.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" -#include "base/win_util.h" #include "base/win/registry.h" +#include "base/win/win_util.h" #include "breakpad/src/client/windows/handler/exception_handler.h" #include "chrome/app/hard_error_handler_win.h" #include "chrome/common/child_process_logging.h" @@ -508,7 +508,7 @@ static DWORD __stdcall InitCrashReporterThread(void* param) { // Per-user install: "NamedPipe\GoogleCrashServices\<user SID>" std::wstring user_sid; if (is_per_user_install) { - if (!win_util::GetUserSidString(&user_sid)) { + if (!base::win::GetUserSidString(&user_sid)) { if (callback) InitDefaultCrashCallback(); return -1; diff --git a/chrome/browser/automation/ui_controls_win.cc b/chrome/browser/automation/ui_controls_win.cc index 25469ad..b03c97b 100644 --- a/chrome/browser/automation/ui_controls_win.cc +++ b/chrome/browser/automation/ui_controls_win.cc @@ -8,7 +8,6 @@ #include "app/keyboard_codes.h" #include "base/logging.h" #include "base/message_loop.h" -#include "base/win_util.h" #include "base/ref_counted.h" #include "base/task.h" #include "views/view.h" diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc index 92c24a3..0f84abe 100644 --- a/chrome/browser/download/download_util.cc +++ b/chrome/browser/download/download_util.cc @@ -74,7 +74,6 @@ #include "app/win_util.h" #include "app/win/drag_source.h" #include "base/win/scoped_comptr.h" -#include "base/win_util.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/views/frame/browser_view.h" #endif diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc index 976d27d..ac4cfba 100644 --- a/chrome/browser/external_tab_container_win.cc +++ b/chrome/browser/external_tab_container_win.cc @@ -12,7 +12,7 @@ #include "base/i18n/rtl.h" #include "base/logging.h" #include "base/utf_string_conversions.h" -#include "base/win_util.h" +#include "base/win/win_util.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/app/chrome_dll_resource.h" #include "chrome/browser/automation/automation_provider.h" @@ -527,7 +527,7 @@ gfx::NativeWindow ExternalTabContainer::GetFrameNativeWindow() { bool ExternalTabContainer::TakeFocus(bool reverse) { if (automation_) { automation_->Send(new AutomationMsg_TabbedOut(tab_handle_, - win_util::IsShiftPressed())); + base::win::IsShiftPressed())); } return true; @@ -844,7 +844,7 @@ bool ExternalTabContainer::ProcessUnhandledKeyStroke(HWND window, if (!automation_) { return false; } - if ((wparam == VK_TAB) && !win_util::IsCtrlPressed()) { + if ((wparam == VK_TAB) && !base::win::IsCtrlPressed()) { // Tabs are handled separately (except if this is Ctrl-Tab or // Ctrl-Shift-Tab) return false; diff --git a/chrome/browser/geolocation/win7_location_api_unittest_win.cc b/chrome/browser/geolocation/win7_location_api_unittest_win.cc index 16d867c..a22b99b 100644 --- a/chrome/browser/geolocation/win7_location_api_unittest_win.cc +++ b/chrome/browser/geolocation/win7_location_api_unittest_win.cc @@ -12,7 +12,6 @@ #include "base/message_loop.h" #include "base/scoped_ptr.h" #include "base/time.h" -#include "base/win_util.h" #include "chrome/common/geoposition.h" #include "chrome/browser/geolocation/win7_location_api_win.h" #include "testing/gmock/include/gmock/gmock.h" diff --git a/chrome/browser/geolocation/win7_location_api_win.h b/chrome/browser/geolocation/win7_location_api_win.h index 96fcd21..78bbed4 100644 --- a/chrome/browser/geolocation/win7_location_api_win.h +++ b/chrome/browser/geolocation/win7_location_api_win.h @@ -12,7 +12,6 @@ #include <Windows.h> #include "base/time.h" -#include "base/win_util.h" struct Geoposition; diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.cc b/chrome/browser/renderer_host/render_widget_host_view_win.cc index ddbd313..6255d53 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_win.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc @@ -17,7 +17,6 @@ #include "base/process_util.h" #include "base/scoped_comptr_win.h" #include "base/thread.h" -#include "base/win_util.h" #include "base/win/scoped_gdi_object.h" #include "chrome/browser/accessibility/browser_accessibility_win.h" #include "chrome/browser/accessibility/browser_accessibility_manager.h" diff --git a/chrome/browser/shell_integration_win.cc b/chrome/browser/shell_integration_win.cc index ad1f653..aaf1d78 100644 --- a/chrome/browser/shell_integration_win.cc +++ b/chrome/browser/shell_integration_win.cc @@ -17,7 +17,6 @@ #include "base/string_util.h" #include "base/task.h" #include "base/utf_string_conversions.h" -#include "base/win_util.h" #include "base/win/registry.h" #include "base/win/windows_version.h" #include "chrome/browser/browser_thread.h" diff --git a/chrome/browser/ui/views/about_chrome_view.cc b/chrome/browser/ui/views/about_chrome_view.cc index 215c6f0..b6176df 100644 --- a/chrome/browser/ui/views/about_chrome_view.cc +++ b/chrome/browser/ui/views/about_chrome_view.cc @@ -44,7 +44,7 @@ #include "webkit/glue/webkit_glue.h" #if defined(OS_WIN) -#include "base/win_util.h" +#include "base/win/win_util.h" #include "chrome/browser/views/restart_message_box.h" #include "chrome/installer/util/install_util.h" #endif // defined(OS_WIN) @@ -533,7 +533,7 @@ void AboutChromeView::ViewHierarchyChanged(bool is_add, // for Vista is another option. int service_pack_major = 0, service_pack_minor = 0; base::win::GetServicePackLevel(&service_pack_major, &service_pack_minor); - if (win_util::UserAccountControlIsEnabled() || + if (base::win::UserAccountControlIsEnabled() || base::win::GetVersion() == base::win::VERSION_XP || (base::win::GetVersion() == base::win::VERSION_VISTA && service_pack_major >= 1) || diff --git a/chrome/browser/ui/views/create_application_shortcut_view.cc b/chrome/browser/ui/views/create_application_shortcut_view.cc index 4532222..da6e668 100644 --- a/chrome/browser/ui/views/create_application_shortcut_view.cc +++ b/chrome/browser/ui/views/create_application_shortcut_view.cc @@ -32,11 +32,6 @@ #include "views/standard_layout.h" #include "views/window/window.h" - -#if defined(OS_WIN) -#include "base/win_util.h" -#endif // defined(OS_WIN) - namespace { const int kAppIconSize = 32; diff --git a/chrome/browser/ui/views/frame/browser_frame_win.cc b/chrome/browser/ui/views/frame/browser_frame_win.cc index 1fe8a6c..2bbe2c9 100644 --- a/chrome/browser/ui/views/frame/browser_frame_win.cc +++ b/chrome/browser/ui/views/frame/browser_frame_win.cc @@ -11,7 +11,6 @@ #include "app/win/hwnd_util.h" #include "app/win_util.h" -#include "base/win_util.h" #include "chrome/browser/accessibility/browser_accessibility_state.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/browser_list.h" diff --git a/chrome/browser/web_applications/web_app.cc b/chrome/browser/web_applications/web_app.cc index 05d6c9f..4194afd 100644 --- a/chrome/browser/web_applications/web_app.cc +++ b/chrome/browser/web_applications/web_app.cc @@ -38,7 +38,7 @@ #endif // defined(OS_LINUX) #if defined(OS_WIN) -#include "base/win_util.h" +#include "base/win/win_util.h" #include "chrome/common/notification_details.h" #include "chrome/common/notification_source.h" #include "gfx/icon_util.h" diff --git a/chrome/common/service_process_util_win.cc b/chrome/common/service_process_util_win.cc index 6d233e9..3e03285 100644 --- a/chrome/common/service_process_util_win.cc +++ b/chrome/common/service_process_util_win.cc @@ -12,7 +12,7 @@ #include "base/scoped_handle_win.h" #include "base/string16.h" #include "base/utf_string_conversions.h" -#include "base/win_util.h" +#include "base/win/win_util.h" #include "chrome/common/chrome_switches.h" namespace { @@ -122,7 +122,7 @@ bool ServiceProcessState::AddToAutoRun() { switches::kServiceProcess); // We need a unique name for the command per user-date-dir. Just use the // channel name. - return win_util::AddCommandToAutoRun( + return base::win::AddCommandToAutoRun( HKEY_CURRENT_USER, UTF8ToWide(GetAutoRunKey()), cmd_line.command_line_string()); @@ -131,7 +131,7 @@ bool ServiceProcessState::AddToAutoRun() { } bool ServiceProcessState::RemoveFromAutoRun() { - return win_util::RemoveCommandFromAutoRun( + return base::win::RemoveCommandFromAutoRun( HKEY_CURRENT_USER, UTF8ToWide(GetAutoRunKey())); } diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc index 2db0977..48f0f1c 100644 --- a/chrome/installer/setup/setup_main.cc +++ b/chrome/installer/setup/setup_main.cc @@ -21,7 +21,7 @@ #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "base/values.h" -#include "base/win_util.h" +#include "base/win/win_util.h" #include "base/win/windows_version.h" #include "breakpad/src/client/windows/handler/exception_handler.h" #include "chrome/common/chrome_switches.h" @@ -797,7 +797,7 @@ google_breakpad::ExceptionHandler* InitializeCrashReporting( std::wstring user_sid = kSystemPrincipalSid; if (!system_install) { - if (!win_util::GetUserSidString(&user_sid)) { + if (!base::win::GetUserSidString(&user_sid)) { return NULL; } } diff --git a/chrome/tools/profiles/generate_profile.cc b/chrome/tools/profiles/generate_profile.cc index d87366f..9bf4b83 100644 --- a/chrome/tools/profiles/generate_profile.cc +++ b/chrome/tools/profiles/generate_profile.cc @@ -20,7 +20,6 @@ #include "base/string_number_conversions.h" #include "base/time.h" #include "base/utf_string_conversions.h" -#include "base/win_util.h" #include "chrome/browser/browser_thread.h" #include "chrome/browser/history/history.h" #include "chrome/browser/history/top_sites.h" diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc index aa5daff..4af3d2c 100644 --- a/chrome_frame/chrome_active_document.cc +++ b/chrome_frame/chrome_active_document.cc @@ -29,6 +29,7 @@ #include "base/threading/thread_local.h" #include "base/utf_string_conversions.h" #include "base/win/scoped_variant.h" +#include "base/win/win_util.h" #include "grit/generated_resources.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/app/chrome_dll_resource.h" @@ -639,8 +640,8 @@ bool IsFindAccelerator(const MSG& msg) { // TODO(robertshield): This may not stand up to localization. Fix if this // is the case. return msg.message == WM_KEYDOWN && msg.wParam == 'F' && - win_util::IsCtrlPressed() && - !(win_util::IsAltPressed() || win_util::IsShiftPressed()); + base::win::IsCtrlPressed() && + !(base::win::IsAltPressed() || base::win::IsShiftPressed()); } void ChromeActiveDocument::OnAcceleratorPressed(const MSG& accel_message) { diff --git a/chrome_frame/chrome_frame_plugin.h b/chrome_frame/chrome_frame_plugin.h index 4f543b5..9513087 100644 --- a/chrome_frame/chrome_frame_plugin.h +++ b/chrome_frame/chrome_frame_plugin.h @@ -9,7 +9,7 @@ #include <vector> #include "base/ref_counted.h" -#include "base/win_util.h" +#include "base/win/win_util.h" #include "chrome_frame/chrome_frame_automation.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_paths_internal.h" @@ -234,7 +234,7 @@ END_MSG_MAP() HWND chrome_window = automation_client_->tab_window(); if (tab && ::IsWindow(chrome_window)) { DVLOG(1) << "Setting initial focus"; - tab->SetInitialFocus(win_util::IsShiftPressed(), restore_focus_to_view); + tab->SetInitialFocus(base::win::IsShiftPressed(), restore_focus_to_view); } } } diff --git a/chrome_frame/chrome_frame_reporting.cc b/chrome_frame/chrome_frame_reporting.cc index 2d4b105..4c210aa 100644 --- a/chrome_frame/chrome_frame_reporting.cc +++ b/chrome_frame/chrome_frame_reporting.cc @@ -6,7 +6,7 @@ #include "base/file_util.h" #include "base/file_version_info.h" -#include "base/win_util.h" +#include "base/win/win_util.h" #include "chrome/installer/util/google_update_settings.h" #include "chrome/installer/util/install_util.h" #include "chrome_frame/chrome_frame_reporting.h" @@ -79,7 +79,7 @@ bool InitializeCrashReporting() { // Per-user install: "NamedPipe\GoogleCrashServices\<user SID>" std::wstring user_sid; if (InstallUtil::IsPerUserInstall(dll_path)) { - if (!win_util::GetUserSidString(&user_sid)) { + if (!base::win::GetUserSidString(&user_sid)) { return false; } } else { diff --git a/chrome_frame/chrome_tab.cc b/chrome_frame/chrome_tab.cc index 79c846d..b966e5c 100644 --- a/chrome_frame/chrome_tab.cc +++ b/chrome_frame/chrome_tab.cc @@ -347,7 +347,7 @@ HRESULT SetupRunOnce() { // started at next boot. void SetupUserLevelHelper() { // Remove existing run-at-startup entry. - win_util::RemoveCommandFromAutoRun(HKEY_CURRENT_USER, kRunKeyName); + base::win::RemoveCommandFromAutoRun(HKEY_CURRENT_USER, kRunKeyName); // Build the chrome_frame_helper command line. FilePath module_path; @@ -373,7 +373,7 @@ void SetupUserLevelHelper() { if (file_util::PathExists(helper_path)) { // Add new run-at-startup entry. - win_util::AddCommandToAutoRun(HKEY_CURRENT_USER, kRunKeyName, + base::win::AddCommandToAutoRun(HKEY_CURRENT_USER, kRunKeyName, helper_path.value()); // Start new instance. @@ -510,7 +510,7 @@ STDAPI CustomRegistration(UINT reg_flags, BOOL reg, bool is_system) { // that during updates we don't have a time window with no running // helper. Uninstalls and updates will explicitly kill the helper from // within the installer. Unregister existing run-at-startup entry. - win_util::RemoveCommandFromAutoRun(HKEY_CURRENT_USER, kRunKeyName); + base::win::RemoveCommandFromAutoRun(HKEY_CURRENT_USER, kRunKeyName); } } } diff --git a/chrome_frame/test/chrome_frame_test_utils.cc b/chrome_frame/test/chrome_frame_test_utils.cc index 6b1f581..2fc8372 100644 --- a/chrome_frame/test/chrome_frame_test_utils.cc +++ b/chrome_frame/test/chrome_frame_test_utils.cc @@ -21,7 +21,6 @@ #include "base/string_util.h" #include "base/stringprintf.h" #include "base/utf_string_conversions.h" -#include "base/win_util.h" #include "base/win/registry.h" #include "base/win/windows_version.h" #include "ceee/ie/common/ceee_util.h" diff --git a/chrome_frame/test/infobar_unittests.cc b/chrome_frame/test/infobar_unittests.cc index 63e910c..abd7c17 100644 --- a/chrome_frame/test/infobar_unittests.cc +++ b/chrome_frame/test/infobar_unittests.cc @@ -9,10 +9,8 @@ #include <atlwin.h> #include "base/string_number_conversions.h" -#include "base/win_util.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/gmock/include/gmock/gmock.h" - #include "chrome_frame/infobars/infobar_content.h" #include "chrome_frame/infobars/internal/displaced_window_manager.h" #include "chrome_frame/infobars/internal/host_window_manager.h" diff --git a/gfx/platform_font_win.cc b/gfx/platform_font_win.cc index 8191c44..34761c6 100644 --- a/gfx/platform_font_win.cc +++ b/gfx/platform_font_win.cc @@ -12,7 +12,7 @@ #include "base/logging.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" -#include "base/win_util.h" +#include "base/win/win_util.h" #include "gfx/canvas_skia.h" #include "gfx/font.h" @@ -164,7 +164,7 @@ void PlatformFontWin::InitWithFontNameAndSize(const std::wstring& font_name, PlatformFontWin::HFontRef* PlatformFontWin::GetBaseFontRef() { if (base_font_ref_ == NULL) { NONCLIENTMETRICS metrics; - win_util::GetNonClientMetrics(&metrics); + base::win::GetNonClientMetrics(&metrics); if (adjust_font_callback) adjust_font_callback(&metrics.lfMessageFont); diff --git a/ipc/ipc_channel_win.cc b/ipc/ipc_channel_win.cc index 0e7ba1b..823c2bb 100644 --- a/ipc/ipc_channel_win.cc +++ b/ipc/ipc_channel_win.cc @@ -13,7 +13,6 @@ #include "base/logging.h" #include "base/non_thread_safe.h" #include "base/utf_string_conversions.h" -#include "base/win_util.h" #include "ipc/ipc_logging.h" #include "ipc/ipc_message_utils.h" diff --git a/views/controls/button/native_button_win.cc b/views/controls/button/native_button_win.cc index 71434e0..f0b1b36 100644 --- a/views/controls/button/native_button_win.cc +++ b/views/controls/button/native_button_win.cc @@ -9,7 +9,7 @@ #include "base/logging.h" #include "base/win/scoped_comptr.h" -#include "base/win_util.h" +#include "base/win/win_util.h" #include "base/win/windows_version.h" #include "views/controls/button/checkbox.h" #include "views/controls/button/native_button.h" @@ -41,7 +41,7 @@ void NativeButtonWin::UpdateLabel() { // update the button text so Windows can lay out the shield icon and the // button text correctly. if (base::win::GetVersion() >= base::win::VERSION_VISTA && - win_util::UserAccountControlIsEnabled()) { + base::win::UserAccountControlIsEnabled()) { Button_SetElevationRequiredState(native_view(), native_button_->need_elevation()); } diff --git a/views/controls/menu/menu_config_win.cc b/views/controls/menu/menu_config_win.cc index 35ab9e2..3882cb4 100644 --- a/views/controls/menu/menu_config_win.cc +++ b/views/controls/menu/menu_config_win.cc @@ -10,7 +10,7 @@ #include "app/l10n_util_win.h" #include "base/logging.h" -#include "base/win_util.h" +#include "base/win/win_util.h" #include "gfx/native_theme_win.h" using gfx::NativeTheme; @@ -26,7 +26,7 @@ MenuConfig* MenuConfig::Create() { COLOR_MENUTEXT); NONCLIENTMETRICS metrics; - win_util::GetNonClientMetrics(&metrics); + base::win::GetNonClientMetrics(&metrics); l10n_util::AdjustUIFont(&(metrics.lfMenuFont)); HFONT font = CreateFontIndirect(&metrics.lfMenuFont); DLOG_ASSERT(font); diff --git a/views/controls/menu/menu_item_view.cc b/views/controls/menu/menu_item_view.cc index e0bd038..cfec12c 100644 --- a/views/controls/menu/menu_item_view.cc +++ b/views/controls/menu/menu_item_view.cc @@ -17,7 +17,7 @@ #include "views/controls/menu/submenu_view.h" #if defined(OS_WIN) -#include "base/win_util.h" +#include "base/win/win_util.h" #endif namespace views { @@ -162,7 +162,7 @@ void MenuItemView::RunMenuAt(gfx::NativeWindow parent, // We don't currently need this on gtk as showing the menu gives focus to the // button first. if (!show_mnemonics) - show_mnemonics = win_util::IsAltPressed(); + show_mnemonics = base::win::IsAltPressed(); #endif PrepareForRun(has_mnemonics, show_mnemonics); int mouse_event_flags; diff --git a/views/controls/textfield/textfield.cc b/views/controls/textfield/textfield.cc index e92794d..68c0f1c 100644 --- a/views/controls/textfield/textfield.cc +++ b/views/controls/textfield/textfield.cc @@ -22,7 +22,7 @@ #include "app/keyboard_code_conversion_gtk.h" #elif defined(OS_WIN) #include "app/win_util.h" -#include "base/win_util.h" +#include "base/win/win_util.h" // TODO(beng): this should be removed when the OS_WIN hack from // ViewHierarchyChanged is removed. #include "views/controls/textfield/native_textfield_win.h" @@ -364,11 +364,11 @@ app::KeyboardCode Textfield::Keystroke::GetKeyboardCode() const { #if defined(OS_WIN) bool Textfield::Keystroke::IsControlHeld() const { - return win_util::IsCtrlPressed(); + return base::win::IsCtrlPressed(); } bool Textfield::Keystroke::IsShiftHeld() const { - return win_util::IsShiftPressed(); + return base::win::IsShiftPressed(); } #else bool Textfield::Keystroke::IsControlHeld() const { diff --git a/views/controls/tree/tree_view.cc b/views/controls/tree/tree_view.cc index 5fe2ef9..746330d 100644 --- a/views/controls/tree/tree_view.cc +++ b/views/controls/tree/tree_view.cc @@ -14,7 +14,7 @@ #include "base/i18n/rtl.h" #include "base/logging.h" #include "base/stl_util-inl.h" -#include "base/win_util.h" +#include "base/win/win_util.h" #include "gfx/canvas_skia.h" #include "gfx/canvas_skia_paint.h" #include "gfx/favicon_size.h" @@ -463,9 +463,9 @@ bool TreeView::OnKeyDown(app::KeyboardCode virtual_key_code) { Widget* widget = GetWidget(); DCHECK(widget); Accelerator accelerator(Accelerator(virtual_key_code, - win_util::IsShiftPressed(), - win_util::IsCtrlPressed(), - win_util::IsAltPressed())); + base::win::IsShiftPressed(), + base::win::IsCtrlPressed(), + base::win::IsAltPressed())); GetFocusManager()->ProcessAccelerator(accelerator); return true; } diff --git a/views/focus/accelerator_handler_win.cc b/views/focus/accelerator_handler_win.cc index 496acd4..6e50800 100644 --- a/views/focus/accelerator_handler_win.cc +++ b/views/focus/accelerator_handler_win.cc @@ -6,7 +6,6 @@ #include "app/keyboard_code_conversion_win.h" #include "app/keyboard_codes.h" -#include "base/win_util.h" #include "views/event.h" #include "views/focus/focus_manager.h" diff --git a/views/focus/focus_util_win.cc b/views/focus/focus_util_win.cc index 7261075..ad42054 100644 --- a/views/focus/focus_util_win.cc +++ b/views/focus/focus_util_win.cc @@ -9,7 +9,6 @@ #include "app/win/hwnd_util.h" #include "app/view_prop.h" #include "base/auto_reset.h" -#include "base/win_util.h" using app::ViewProp; diff --git a/views/window/custom_frame_view.cc b/views/window/custom_frame_view.cc index 89d9491..97287e1 100644 --- a/views/window/custom_frame_view.cc +++ b/views/window/custom_frame_view.cc @@ -8,7 +8,6 @@ #include "app/resource_bundle.h" #if defined(OS_WIN) #include "app/win_util.h" -#include "base/win_util.h" #endif #include "gfx/canvas.h" #include "gfx/font.h" diff --git a/webkit/tools/test_shell/test_shell_platform_delegate_win.cc b/webkit/tools/test_shell/test_shell_platform_delegate_win.cc index 2c7510d..80c95ab 100644 --- a/webkit/tools/test_shell/test_shell_platform_delegate_win.cc +++ b/webkit/tools/test_shell/test_shell_platform_delegate_win.cc @@ -10,7 +10,7 @@ #include "base/command_line.h" #include "base/event_recorder.h" #include "base/resource_util.h" -#include "base/win_util.h" +#include "base/win/win_util.h" #include "gfx/native_theme_win.h" #include "webkit/tools/test_shell/foreground_helper.h" #include "webkit/tools/test_shell/test_shell.h" @@ -95,7 +95,7 @@ bool TestShellPlatformDelegate::CheckLayoutTestSystemDependencies() { // Check that we're using the default system fonts NONCLIENTMETRICS metrics; - win_util::GetNonClientMetrics(&metrics); + base::win::GetNonClientMetrics(&metrics); LOGFONTW* system_fonts[] = { &metrics.lfStatusFont, &metrics.lfMenuFont, &metrics.lfSmCaptionFont }; |