diff options
author | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-31 20:39:02 +0000 |
---|---|---|
committer | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-31 20:39:02 +0000 |
commit | fd85ad650d68309b965dbc9f3d6823cf2754349c (patch) | |
tree | 28b98629e02b2e05ec74272146f249ca62a164da /views | |
parent | ce072a7181ea5d58133e33654133236f5d9f5551 (diff) | |
download | chromium_src-fd85ad650d68309b965dbc9f3d6823cf2754349c.zip chromium_src-fd85ad650d68309b965dbc9f3d6823cf2754349c.tar.gz chromium_src-fd85ad650d68309b965dbc9f3d6823cf2754349c.tar.bz2 |
Move app/win_util to app/win and fix the namespace usage.
Split out the two classes: ScopedComInitializer and ScopedCOMem (which I renamed) to separate files.
I removed the win_util_path file which had one function in it and moved the function to win_util.
Somehow, this was getting picked up by the nacl64 build and the call in sandbox_policy was then not being
defined. I just implemented the function in-plcae since it's just a simple wrapper around a Windows API call.
TEST=it compiles
BUG=none
Review URL: http://codereview.chromium.org/6013009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70343 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/controls/textfield/native_textfield_win.cc | 4 | ||||
-rw-r--r-- | views/controls/textfield/textfield.cc | 4 | ||||
-rw-r--r-- | views/widget/tooltip_manager_win.cc | 6 | ||||
-rw-r--r-- | views/widget/widget_win.cc | 4 | ||||
-rw-r--r-- | views/window/custom_frame_view.cc | 12 | ||||
-rw-r--r-- | views/window/window_win.cc | 20 |
6 files changed, 26 insertions, 24 deletions
diff --git a/views/controls/textfield/native_textfield_win.cc b/views/controls/textfield/native_textfield_win.cc index d559592..581e40f 100644 --- a/views/controls/textfield/native_textfield_win.cc +++ b/views/controls/textfield/native_textfield_win.cc @@ -11,7 +11,7 @@ #include "app/keyboard_codes.h" #include "app/l10n_util.h" #include "app/l10n_util_win.h" -#include "app/win_util.h" +#include "app/win/win_util.h" #include "base/i18n/rtl.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" @@ -644,7 +644,7 @@ void NativeTextfieldWin::OnLButtonDown(UINT keys, const CPoint& point) { // double_click_time_ from the current message's time even if the timer has // wrapped in between. const bool is_triple_click = tracking_double_click_ && - win_util::IsDoubleClick(double_click_point_, point, + app::win::IsDoubleClick(double_click_point_, point, GetCurrentMessage()->time - double_click_time_); tracking_double_click_ = false; diff --git a/views/controls/textfield/textfield.cc b/views/controls/textfield/textfield.cc index 68c0f1c..89959cc 100644 --- a/views/controls/textfield/textfield.cc +++ b/views/controls/textfield/textfield.cc @@ -21,7 +21,7 @@ #if defined(OS_LINUX) #include "app/keyboard_code_conversion_gtk.h" #elif defined(OS_WIN) -#include "app/win_util.h" +#include "app/win/win_util.h" #include "base/win/win_util.h" // TODO(beng): this should be removed when the OS_WIN hack from // ViewHierarchyChanged is removed. @@ -279,7 +279,7 @@ bool Textfield::SkipDefaultKeyEventProcessing(const KeyEvent& e) { // We don't translate accelerators for ALT + NumPad digit on Windows, they are // used for entering special characters. We do translate alt-home. if (e.IsAltDown() && (key != app::VKEY_HOME) && - win_util::IsNumPadDigit(key, e.IsExtendedKey())) + app::win::IsNumPadDigit(key, e.IsExtendedKey())) return true; #endif return false; diff --git a/views/widget/tooltip_manager_win.cc b/views/widget/tooltip_manager_win.cc index 8e51e64..b7b3a09 100644 --- a/views/widget/tooltip_manager_win.cc +++ b/views/widget/tooltip_manager_win.cc @@ -8,7 +8,7 @@ #include <limits> #include "app/l10n_util_win.h" -#include "app/win_util.h" +#include "app/win/win_util.h" #include "base/i18n/rtl.h" #include "base/logging.h" #include "base/message_loop.h" @@ -228,7 +228,7 @@ bool TooltipManagerWin::SetTooltipPosition(int text_x, int text_y) { // doesn't, return false so that windows positions the tooltip at the // default location. gfx::Rect monitor_bounds = - win_util::GetMonitorBoundsForRect(gfx::Rect(bounds.left,bounds.right, + app::win::GetMonitorBoundsForRect(gfx::Rect(bounds.left,bounds.right, 0, 0)); if (!monitor_bounds.Contains(gfx::Rect(bounds))) { return false; @@ -356,7 +356,7 @@ void TooltipManagerWin::ShowKeyboardTooltip(View* focused_view) { screen_point.y() + focused_bounds.height() + line_count * tooltip_height_ }; gfx::Rect monitor_bounds = - win_util::GetMonitorBoundsForRect(gfx::Rect(rect_bounds)); + app::win::GetMonitorBoundsForRect(gfx::Rect(rect_bounds)); rect_bounds = gfx::Rect(rect_bounds).AdjustToFit(monitor_bounds).ToRECT(); ::SetWindowPos(keyboard_tooltip_hwnd_, NULL, rect_bounds.left, rect_bounds.top, 0, 0, diff --git a/views/widget/widget_win.cc b/views/widget/widget_win.cc index a5ea141..8bf6a3f 100644 --- a/views/widget/widget_win.cc +++ b/views/widget/widget_win.cc @@ -9,7 +9,7 @@ #include "app/system_monitor.h" #include "app/view_prop.h" #include "app/win/hwnd_util.h" -#include "app/win_util.h" +#include "app/win/win_util.h" #include "base/string_util.h" #include "gfx/canvas_skia.h" #include "gfx/native_theme_win.h" @@ -389,7 +389,7 @@ bool WidgetWin::IsVisible() const { } bool WidgetWin::IsActive() const { - return win_util::IsWindowActive(hwnd()); + return app::win::IsWindowActive(hwnd()); } bool WidgetWin::IsAccessibleWidget() const { diff --git a/views/window/custom_frame_view.cc b/views/window/custom_frame_view.cc index 97287e1..002bb37 100644 --- a/views/window/custom_frame_view.cc +++ b/views/window/custom_frame_view.cc @@ -6,9 +6,6 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" -#if defined(OS_WIN) -#include "app/win_util.h" -#endif #include "gfx/canvas.h" #include "gfx/font.h" #include "gfx/path.h" @@ -16,10 +13,15 @@ #include "grit/app_strings.h" #include "views/window/client_view.h" #include "views/window/window_shape.h" +#include "views/window/window_delegate.h" + #if defined(OS_LINUX) #include "views/window/hit_test.h" #endif -#include "views/window/window_delegate.h" + +#if defined(OS_WIN) +#include "app/win/win_util.h" +#endif namespace views { @@ -566,7 +568,7 @@ void CustomFrameView::InitClass() { static bool initialized = false; if (!initialized) { #if defined(OS_WIN) - title_font_ = new gfx::Font(win_util::GetWindowTitleFont()); + title_font_ = new gfx::Font(app::win::GetWindowTitleFont()); #elif defined(OS_LINUX) // TODO(ben): need to resolve what font this is. title_font_ = new gfx::Font(); diff --git a/views/window/window_win.cc b/views/window/window_win.cc index 664e17f..c0f4523 100644 --- a/views/window/window_win.cc +++ b/views/window/window_win.cc @@ -10,7 +10,7 @@ #include "app/keyboard_code_conversion_win.h" #include "app/theme_provider.h" #include "app/win/hwnd_util.h" -#include "app/win_util.h" +#include "app/win/win_util.h" #include "base/i18n/rtl.h" #include "base/win/windows_version.h" #include "gfx/canvas_skia_paint.h" @@ -88,7 +88,7 @@ void SetChildBounds(HWND child_window, HWND parent_window, } gfx::Rect actual_bounds = bounds; - win_util::EnsureRectIsVisibleInRect(gfx::Rect(parent_rect), &actual_bounds, + app::win::EnsureRectIsVisibleInRect(gfx::Rect(parent_rect), &actual_bounds, padding); SetWindowPos(child_window, insert_after_window, actual_bounds.x(), @@ -843,9 +843,9 @@ LRESULT WindowWin::OnNCCalcSize(BOOL mode, LPARAM l_param) { return 0; } } - if (win_util::EdgeHasTopmostAutoHideTaskbar(ABE_LEFT, monitor)) - client_rect->left += win_util::kAutoHideTaskbarThicknessPx; - if (win_util::EdgeHasTopmostAutoHideTaskbar(ABE_TOP, monitor)) { + if (app::win::EdgeHasTopmostAutoHideTaskbar(ABE_LEFT, monitor)) + client_rect->left += app::win::kAutoHideTaskbarThicknessPx; + if (app::win::EdgeHasTopmostAutoHideTaskbar(ABE_TOP, monitor)) { if (GetNonClientView()->UseNativeFrame()) { // Tricky bit. Due to a bug in DwmDefWindowProc()'s handling of // WM_NCHITTEST, having any nonclient area atop the window causes the @@ -858,13 +858,13 @@ LRESULT WindowWin::OnNCCalcSize(BOOL mode, LPARAM l_param) { // be no better solution. --client_rect->bottom; } else { - client_rect->top += win_util::kAutoHideTaskbarThicknessPx; + client_rect->top += app::win::kAutoHideTaskbarThicknessPx; } } - if (win_util::EdgeHasTopmostAutoHideTaskbar(ABE_RIGHT, monitor)) - client_rect->right -= win_util::kAutoHideTaskbarThicknessPx; - if (win_util::EdgeHasTopmostAutoHideTaskbar(ABE_BOTTOM, monitor)) - client_rect->bottom -= win_util::kAutoHideTaskbarThicknessPx; + if (app::win::EdgeHasTopmostAutoHideTaskbar(ABE_RIGHT, monitor)) + client_rect->right -= app::win::kAutoHideTaskbarThicknessPx; + if (app::win::EdgeHasTopmostAutoHideTaskbar(ABE_BOTTOM, monitor)) + client_rect->bottom -= app::win::kAutoHideTaskbarThicknessPx; // We cannot return WVR_REDRAW when there is nonclient area, or Windows // exhibits bugs where client pixels and child HWNDs are mispositioned by |