diff options
Diffstat (limited to 'ui')
58 files changed, 167 insertions, 175 deletions
diff --git a/ui/aura/root_window_host_win.h b/ui/aura/root_window_host_win.h index e2a60dd..42c8ada 100644 --- a/ui/aura/root_window_host_win.h +++ b/ui/aura/root_window_host_win.h @@ -8,11 +8,11 @@ #include "base/compiler_specific.h" #include "ui/aura/root_window_host.h" #include "ui/base/ui_export.h" -#include "ui/base/win/window_impl.h" +#include "ui/gfx/win/window_impl.h" namespace aura { -class RootWindowHostWin : public RootWindowHost, public ui::WindowImpl { +class RootWindowHostWin : public RootWindowHost, public gfx::WindowImpl { public: RootWindowHostWin(const gfx::Rect& bounds); virtual ~RootWindowHostWin(); diff --git a/ui/base/ime/input_method_win.cc b/ui/base/ime/input_method_win.cc index 90f87da..3982c22 100644 --- a/ui/base/ime/input_method_win.cc +++ b/ui/base/ime/input_method_win.cc @@ -10,7 +10,7 @@ #include "ui/base/events/event_utils.h" #include "ui/base/ime/text_input_client.h" #include "ui/base/keycodes/keyboard_codes.h" -#include "ui/base/win/hwnd_util.h" +#include "ui/gfx/win/hwnd_util.h" namespace ui { namespace { @@ -158,7 +158,7 @@ LRESULT InputMethodWin::OnChar(HWND window_handle, // Note: Setting |handled| to FALSE for DefWindowProc triggering of the system // menu causes undesirable titlebar artifacts in the classic theme. if (message == WM_SYSCHAR && wparam == VK_SPACE) - ui::ShowSystemMenu(window_handle); + gfx::ShowSystemMenu(window_handle); return 0; } diff --git a/ui/base/l10n/l10n_util_win.cc b/ui/base/l10n/l10n_util_win.cc index c49452c..0fa34cf 100644 --- a/ui/base/l10n/l10n_util_win.cc +++ b/ui/base/l10n/l10n_util_win.cc @@ -15,7 +15,7 @@ #include "base/win/windows_version.h" #include "grit/app_locale_settings.h" #include "ui/base/l10n/l10n_util.h" -#include "ui/gfx/dpi_win.h" +#include "ui/gfx/win/dpi.h" namespace { diff --git a/ui/base/l10n/l10n_util_win_unittest.cc b/ui/base/l10n/l10n_util_win_unittest.cc index 3ef1100..c4ae888 100644 --- a/ui/base/l10n/l10n_util_win_unittest.cc +++ b/ui/base/l10n/l10n_util_win_unittest.cc @@ -9,7 +9,7 @@ #include "base/win/win_util.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" -#include "ui/gfx/dpi_win.h" +#include "ui/gfx/win/dpi.h" typedef PlatformTest L10nUtilWinTest; diff --git a/ui/base/layout.cc b/ui/base/layout.cc index c035ae9..40a0a9c 100644 --- a/ui/base/layout.cc +++ b/ui/base/layout.cc @@ -23,7 +23,7 @@ #if defined(OS_WIN) #include "base/win/metro.h" -#include "ui/gfx/dpi_win.h" +#include "ui/gfx/win/dpi.h" #include <Windows.h> #endif // defined(OS_WIN) diff --git a/ui/base/resource/resource_bundle_win.cc b/ui/base/resource/resource_bundle_win.cc index ffd2cd0..0a2b185 100644 --- a/ui/base/resource/resource_bundle_win.cc +++ b/ui/base/resource/resource_bundle_win.cc @@ -10,7 +10,7 @@ #include "ui/base/layout.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_data_dll_win.h" -#include "ui/gfx/dpi_win.h" +#include "ui/gfx/win/dpi.h" namespace ui { diff --git a/ui/base/ui_base_switches.cc b/ui/base/ui_base_switches.cc index 3adb215..ca4586b 100644 --- a/ui/base/ui_base_switches.cc +++ b/ui/base/ui_base_switches.cc @@ -33,9 +33,6 @@ const char kEnableTouchEditing[] = "enable-touch-editing"; // Enables the Views textfield on Windows. const char kEnableViewsTextfield[] = "enable-views-textfield"; -// Overrides the device scale factor for the browser UI and the contents. -const char kForceDeviceScaleFactor[] = "force-device-scale-factor"; - // If a resource is requested at a scale factor at which it is not available // or the resource is the incorrect size (based on the size of the 1x resource), // generates the missing resource and applies a red mask to the generated diff --git a/ui/base/ui_base_switches.h b/ui/base/ui_base_switches.h index cbe9a77..7e4c9a7 100644 --- a/ui/base/ui_base_switches.h +++ b/ui/base/ui_base_switches.h @@ -21,7 +21,6 @@ UI_EXPORT extern const char kEnableScrollPrediction[]; UI_EXPORT extern const char kEnableTouchDragDrop[]; UI_EXPORT extern const char kEnableTouchEditing[]; UI_EXPORT extern const char kEnableViewsTextfield[]; -UI_EXPORT extern const char kForceDeviceScaleFactor[]; UI_EXPORT extern const char kHighlightMissingScaledResources[]; UI_EXPORT extern const char kLang[]; UI_EXPORT extern const char kLocalePak[]; diff --git a/ui/base/win/events_win.cc b/ui/base/win/events_win.cc index 4381cb0..6cb6d81 100644 --- a/ui/base/win/events_win.cc +++ b/ui/base/win/events_win.cc @@ -11,8 +11,8 @@ #include "base/win/win_util.h" #include "ui/base/events/event_utils.h" #include "ui/base/keycodes/keyboard_code_conversion_win.h" -#include "ui/gfx/dpi_win.h" #include "ui/gfx/point.h" +#include "ui/gfx/win/dpi.h" namespace ui { diff --git a/ui/base/win/foreground_helper.cc b/ui/base/win/foreground_helper.cc index 0b03582..219b26f 100644 --- a/ui/base/win/foreground_helper.cc +++ b/ui/base/win/foreground_helper.cc @@ -5,7 +5,7 @@ #include "ui/base/win/foreground_helper.h" #include "base/logging.h" -#include "ui/base/win/window_impl.h" +#include "ui/gfx/win/window_impl.h" namespace ui { diff --git a/ui/base/win/foreground_helper.h b/ui/base/win/foreground_helper.h index 7fc1834..e8101a0 100644 --- a/ui/base/win/foreground_helper.h +++ b/ui/base/win/foreground_helper.h @@ -6,7 +6,7 @@ #define UI_BASE_WIN_FOREGROUND_HELPER_H_ #include "base/logging.h" -#include "ui/base/win/window_impl.h" +#include "ui/gfx/win/window_impl.h" namespace ui { @@ -17,7 +17,7 @@ namespace ui { // to be capable of moving to the foreground. // // This is probably leveraging a windows bug. -class UI_EXPORT ForegroundHelper : public WindowImpl { +class UI_EXPORT ForegroundHelper : public gfx::WindowImpl { public: ForegroundHelper() : window_(NULL) { } diff --git a/ui/base/win/hidden_window.cc b/ui/base/win/hidden_window.cc index fb4f483..3b21519 100644 --- a/ui/base/win/hidden_window.cc +++ b/ui/base/win/hidden_window.cc @@ -4,7 +4,7 @@ #include "ui/base/win/hidden_window.h" -#include "ui/base/win/window_impl.h" +#include "ui/gfx/win/window_impl.h" namespace ui { @@ -21,7 +21,7 @@ namespace { // window that interact poorly with us. // // See: http://crbug.com/16476 -class TempParent : public ui::WindowImpl { +class TempParent : public gfx::WindowImpl { public: static TempParent* Get() { static TempParent* g_temp_parent; diff --git a/ui/base/win/hwnd_subclass.cc b/ui/base/win/hwnd_subclass.cc index cd557fa..34e2bf4 100644 --- a/ui/base/win/hwnd_subclass.cc +++ b/ui/base/win/hwnd_subclass.cc @@ -9,8 +9,8 @@ #include "base/logging.h" #include "base/memory/scoped_vector.h" #include "base/memory/singleton.h" -#include "ui/base/win/hwnd_util.h" -#include "ui/gfx/dpi_win.h" +#include "ui/gfx/win/dpi.h" +#include "ui/gfx/win/hwnd_util.h" namespace { const char kHWNDSubclassKey[] = "__UI_BASE_WIN_HWND_SUBCLASS_PROC__"; @@ -123,7 +123,7 @@ HWNDSubclass::HWNDSubclass(HWND target) : target_(target), original_wnd_proc_(GetCurrentWndProc(target)), prop_(target, kHWNDSubclassKey, this) { - ui::SetWindowProc(target_, &WndProc); + gfx::SetWindowProc(target_, &WndProc); } HWNDSubclass::~HWNDSubclass() { diff --git a/ui/base/win/hwnd_subclass_unittest.cc b/ui/base/win/hwnd_subclass_unittest.cc index 5917ef2..520f52b 100644 --- a/ui/base/win/hwnd_subclass_unittest.cc +++ b/ui/base/win/hwnd_subclass_unittest.cc @@ -6,13 +6,13 @@ #include "base/basictypes.h" #include "testing/gtest/include/gtest/gtest.h" -#include "ui/base/win/window_impl.h" +#include "ui/gfx/win/window_impl.h" namespace ui { namespace { -class TestWindow : public ui::WindowImpl { +class TestWindow : public gfx::WindowImpl { public: TestWindow() : saw_message(false) {} virtual ~TestWindow() {} @@ -20,7 +20,7 @@ class TestWindow : public ui::WindowImpl { bool saw_message; private: - // Overridden from ui::WindowImpl: + // Overridden from gfx::WindowImpl: virtual BOOL ProcessWindowMessage(HWND window, UINT message, WPARAM w_param, diff --git a/ui/base/win/mouse_wheel_util.cc b/ui/base/win/mouse_wheel_util.cc index 941c069..223e3a8 100644 --- a/ui/base/win/mouse_wheel_util.cc +++ b/ui/base/win/mouse_wheel_util.cc @@ -8,7 +8,7 @@ #include "base/auto_reset.h" #include "ui/base/view_prop.h" -#include "ui/base/win/hwnd_util.h" +#include "ui/gfx/win/hwnd_util.h" namespace ui { @@ -31,7 +31,7 @@ static bool WindowSupportsRerouteMouseWheel(HWND window) { } static bool IsCompatibleWithMouseWheelRedirection(HWND window) { - std::wstring class_name = GetClassName(window); + std::wstring class_name = gfx::GetClassName(window); // Mousewheel redirection to comboboxes is a surprising and // undesireable user behavior. return !(class_name == L"ComboBox" || @@ -39,7 +39,7 @@ static bool IsCompatibleWithMouseWheelRedirection(HWND window) { } static bool CanRedirectMouseWheelFrom(HWND window) { - std::wstring class_name = GetClassName(window); + std::wstring class_name = gfx::GetClassName(window); // Older Thinkpad mouse wheel drivers create a window under mouse wheel // pointer. Detect if we are dealing with this window. In this case we diff --git a/ui/compositor/test/test_compositor_host_win.cc b/ui/compositor/test/test_compositor_host_win.cc index 452acee..60b7b0c 100644 --- a/ui/compositor/test/test_compositor_host_win.cc +++ b/ui/compositor/test/test_compositor_host_win.cc @@ -6,13 +6,13 @@ #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" -#include "ui/base/win/window_impl.h" #include "ui/compositor/compositor.h" +#include "ui/gfx/win/window_impl.h" namespace ui { class TestCompositorHostWin : public TestCompositorHost, - public WindowImpl, + public gfx::WindowImpl, public CompositorDelegate { public: TestCompositorHostWin(const gfx::Rect& bounds) { diff --git a/ui/gfx/canvas_paint_win.h b/ui/gfx/canvas_paint_win.h index ed31a6e..c5d3aee 100644 --- a/ui/gfx/canvas_paint_win.h +++ b/ui/gfx/canvas_paint_win.h @@ -7,8 +7,8 @@ #include "skia/ext/platform_canvas.h" #include "ui/gfx/canvas.h" -#include "ui/gfx/dpi_win.h" #include "ui/gfx/size.h" +#include "ui/gfx/win/dpi.h" namespace gfx { diff --git a/ui/gfx/display.cc b/ui/gfx/display.cc index 02d97a9..d3f0745 100644 --- a/ui/gfx/display.cc +++ b/ui/gfx/display.cc @@ -8,11 +8,11 @@ #include "base/logging.h" #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" -#include "ui/base/ui_base_switches.h" #include "ui/gfx/insets.h" #include "ui/gfx/point_conversions.h" #include "ui/gfx/point_f.h" #include "ui/gfx/size_conversions.h" +#include "ui/gfx/switches.h" namespace gfx { namespace { diff --git a/ui/gfx/font_smoothing_win.cc b/ui/gfx/font_smoothing_win.cc index a4be729..b181fb5 100644 --- a/ui/gfx/font_smoothing_win.cc +++ b/ui/gfx/font_smoothing_win.cc @@ -5,13 +5,13 @@ #include "ui/gfx/font_smoothing_win.h" #include "base/memory/singleton.h" -#include "ui/base/win/singleton_hwnd.h" +#include "ui/gfx/win/singleton_hwnd.h" namespace { // Helper class to cache font smoothing settings and listen for notifications // to re-query them from the system. -class CachedFontSmoothingSettings : public ui::SingletonHwnd::Observer { +class CachedFontSmoothingSettings : public gfx::SingletonHwnd::Observer { public: static CachedFontSmoothingSettings* GetInstance(); @@ -66,7 +66,7 @@ void CachedFontSmoothingSettings::GetFontSmoothingSettings( need_to_query_settings_ = false; } if (!observer_added_) { - ui::SingletonHwnd::GetInstance()->AddObserver(this); + gfx::SingletonHwnd::GetInstance()->AddObserver(this); observer_added_ = true; } *smoothing_enabled = smoothing_enabled_; diff --git a/ui/gfx/platform_font_win.cc b/ui/gfx/platform_font_win.cc index 4a792f6..2d4c006 100644 --- a/ui/gfx/platform_font_win.cc +++ b/ui/gfx/platform_font_win.cc @@ -17,9 +17,9 @@ #include "base/win/scoped_hdc.h" #include "base/win/scoped_select_object.h" #include "base/win/win_util.h" -#include "ui/base/win/scoped_set_map_mode.h" #include "ui/gfx/canvas.h" #include "ui/gfx/font.h" +#include "ui/gfx/win/scoped_set_map_mode.h" namespace { @@ -229,7 +229,7 @@ PlatformFontWin::HFontRef* PlatformFontWin::CreateHFontRef(HFONT font) { { base::win::ScopedGetDC screen_dc(NULL); base::win::ScopedSelectObject scoped_font(screen_dc, font); - ui::ScopedSetMapMode mode(screen_dc, MM_TEXT); + gfx::ScopedSetMapMode mode(screen_dc, MM_TEXT); GetTextMetrics(screen_dc, &font_metrics); } @@ -284,7 +284,7 @@ int PlatformFontWin::HFontRef::GetDluBaseX() { base::win::ScopedGetDC screen_dc(NULL); base::win::ScopedSelectObject font(screen_dc, hfont_); - ui::ScopedSetMapMode mode(screen_dc, MM_TEXT); + gfx::ScopedSetMapMode mode(screen_dc, MM_TEXT); // Yes, this is how Microsoft recommends calculating the dialog unit // conversions. See: http://support.microsoft.com/kb/125681 diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc index 06640e0..c4335b4 100644 --- a/ui/gfx/render_text.cc +++ b/ui/gfx/render_text.cc @@ -13,12 +13,12 @@ #include "third_party/icu/source/common/unicode/utf16.h" #include "third_party/skia/include/core/SkTypeface.h" #include "third_party/skia/include/effects/SkGradientShader.h" -#include "ui/base/text/utf16_indexing.h" #include "ui/gfx/canvas.h" #include "ui/gfx/insets.h" #include "ui/gfx/skia_util.h" #include "ui/gfx/text_constants.h" #include "ui/gfx/text_elider.h" +#include "ui/gfx/utf16_indexing.h" namespace gfx { @@ -952,7 +952,7 @@ void RenderText::UpdateLayoutText() { if (obscured_) { size_t obscured_text_length = - static_cast<size_t>(ui::UTF16IndexToOffset(text_, 0, text_.length())); + static_cast<size_t>(gfx::UTF16IndexToOffset(text_, 0, text_.length())); layout_text_.assign(obscured_text_length, kPasswordReplacementChar); if (obscured_reveal_index_ >= 0 && @@ -966,7 +966,7 @@ void RenderText::UpdateLayoutText() { // Gets the index in |layout_text_| to be replaced. const size_t cp_start = - static_cast<size_t>(ui::UTF16IndexToOffset(text_, 0, start)); + static_cast<size_t>(gfx::UTF16IndexToOffset(text_, 0, start)); if (layout_text_.length() > cp_start) layout_text_.replace(cp_start, 1, text_.substr(start, end - start)); } diff --git a/ui/gfx/render_text_linux.cc b/ui/gfx/render_text_linux.cc index c6cf4f2..9ad2a3d 100644 --- a/ui/gfx/render_text_linux.cc +++ b/ui/gfx/render_text_linux.cc @@ -12,11 +12,11 @@ #include "base/i18n/break_iterator.h" #include "base/logging.h" #include "third_party/skia/include/core/SkTypeface.h" -#include "ui/base/text/utf16_indexing.h" #include "ui/gfx/canvas.h" #include "ui/gfx/font.h" #include "ui/gfx/font_render_params_linux.h" #include "ui/gfx/pango_util.h" +#include "ui/gfx/utf16_indexing.h" namespace gfx { @@ -252,7 +252,7 @@ std::vector<Rect> RenderTextLinux::GetSubstringBounds(const gfx::Range& range) { size_t RenderTextLinux::TextIndexToLayoutIndex(size_t index) const { DCHECK(layout_); - ptrdiff_t offset = ui::UTF16IndexToOffset(text(), 0, index); + ptrdiff_t offset = gfx::UTF16IndexToOffset(text(), 0, index); // Clamp layout indices to the length of the text actually used for layout. offset = std::min<size_t>(offset, g_utf8_strlen(layout_text_, -1)); const char* layout_pointer = g_utf8_offset_to_pointer(layout_text_, offset); @@ -263,7 +263,7 @@ size_t RenderTextLinux::LayoutIndexToTextIndex(size_t index) const { DCHECK(layout_); const char* layout_pointer = layout_text_ + index; const long offset = g_utf8_pointer_to_offset(layout_text_, layout_pointer); - return ui::UTF16OffsetToIndex(text(), 0, offset); + return gfx::UTF16OffsetToIndex(text(), 0, offset); } bool RenderTextLinux::IsCursorablePosition(size_t position) { @@ -271,11 +271,11 @@ bool RenderTextLinux::IsCursorablePosition(size_t position) { return true; if (position >= text().length()) return position == text().length(); - if (!ui::IsValidCodePointIndex(text(), position)) + if (!gfx::IsValidCodePointIndex(text(), position)) return false; EnsureLayout(); - ptrdiff_t offset = ui::UTF16IndexToOffset(text(), 0, position); + ptrdiff_t offset = gfx::UTF16IndexToOffset(text(), 0, position); // Check that the index corresponds with a valid text code point, that it is // marked as a legitimate cursor position by Pango, and that it is not // truncated from layout text (its glyph is shown on screen). diff --git a/ui/gfx/render_text_win.cc b/ui/gfx/render_text_win.cc index 2415060..2eff381 100644 --- a/ui/gfx/render_text_win.cc +++ b/ui/gfx/render_text_win.cc @@ -14,11 +14,11 @@ #include "base/strings/utf_string_conversions.h" #include "base/win/windows_version.h" #include "third_party/icu/source/common/unicode/uchar.h" -#include "ui/base/text/utf16_indexing.h" #include "ui/gfx/canvas.h" #include "ui/gfx/font_fallback_win.h" #include "ui/gfx/font_smoothing_win.h" #include "ui/gfx/platform_font_win.h" +#include "ui/gfx/utf16_indexing.h" namespace gfx { @@ -413,7 +413,7 @@ std::vector<Rect> RenderTextWin::GetSubstringBounds(const gfx::Range& range) { size_t RenderTextWin::TextIndexToLayoutIndex(size_t index) const { DCHECK_LE(index, text().length()); - ptrdiff_t i = obscured() ? ui::UTF16IndexToOffset(text(), 0, index) : index; + ptrdiff_t i = obscured() ? gfx::UTF16IndexToOffset(text(), 0, index) : index; CHECK_GE(i, 0); // Clamp layout indices to the length of the text actually used for layout. return std::min<size_t>(GetLayoutText().length(), i); @@ -424,7 +424,7 @@ size_t RenderTextWin::LayoutIndexToTextIndex(size_t index) const { return index; DCHECK_LE(index, GetLayoutText().length()); - const size_t text_index = ui::UTF16OffsetToIndex(text(), 0, index); + const size_t text_index = gfx::UTF16OffsetToIndex(text(), 0, index); DCHECK_LE(text_index, text().length()); return text_index; } @@ -439,7 +439,7 @@ bool RenderTextWin::IsCursorablePosition(size_t position) { // and that its glyph has distinct bounds (not mid-multi-character-grapheme). // An example of a multi-character-grapheme that is not a surrogate-pair is: // \x0915\x093f - (ki) - one of many Devanagari biconsonantal conjuncts. - return ui::IsValidCodePointIndex(text(), position) && + return gfx::IsValidCodePointIndex(text(), position) && position < LayoutIndexToTextIndex(GetLayoutText().length()) && GetGlyphBounds(position) != GetGlyphBounds(position - 1); } @@ -599,7 +599,7 @@ void RenderTextWin::ItemizeLogicalText() { // Clamp run lengths to avoid exceeding the maximum supported glyph count. if ((run_break - run->range.start()) > max_run_length) { run_break = run->range.start() + max_run_length; - if (!ui::IsValidCodePointIndex(layout_text, run_break)) + if (!gfx::IsValidCodePointIndex(layout_text, run_break)) --run_break; } @@ -619,7 +619,7 @@ void RenderTextWin::ItemizeLogicalText() { } } - DCHECK(ui::IsValidCodePointIndex(layout_text, run_break)); + DCHECK(gfx::IsValidCodePointIndex(layout_text, run_break)); style.UpdatePosition(LayoutIndexToTextIndex(run_break)); if (script_item_break == run_break) diff --git a/ui/gfx/screen_win.cc b/ui/gfx/screen_win.cc index 7ae5306..7903cc5 100644 --- a/ui/gfx/screen_win.cc +++ b/ui/gfx/screen_win.cc @@ -11,7 +11,7 @@ #include "base/strings/utf_string_conversions.h" #include "base/win/win_util.h" #include "ui/gfx/display.h" -#include "ui/gfx/dpi_win.h" +#include "ui/gfx/win/dpi.h" namespace { diff --git a/ui/gfx/switches.cc b/ui/gfx/switches.cc index a278f46..2f2eb9a 100644 --- a/ui/gfx/switches.cc +++ b/ui/gfx/switches.cc @@ -4,7 +4,6 @@ #include "ui/gfx/switches.h" -namespace gfx { namespace switches { // Let text glyphs have X-positions that aren't snapped to the pixel grid in @@ -17,8 +16,10 @@ const char kEnableBrowserTextSubpixelPositioning[] = const char kEnableWebkitTextSubpixelPositioning[] = "enable-webkit-text-subpixel-positioning"; +// Overrides the device scale factor for the browser UI and the contents. +const char kForceDeviceScaleFactor[] = "force-device-scale-factor"; + // Enables/Disables High DPI support (windows) const char kHighDPISupport[] = "high-dpi-support"; } // namespace switches -} // namespace gfx diff --git a/ui/gfx/switches.h b/ui/gfx/switches.h index f8069d0..e3cd9e7 100644 --- a/ui/gfx/switches.h +++ b/ui/gfx/switches.h @@ -7,14 +7,13 @@ #include "ui/gfx/gfx_export.h" -namespace gfx { namespace switches { UI_EXPORT extern const char kEnableBrowserTextSubpixelPositioning[]; UI_EXPORT extern const char kEnableWebkitTextSubpixelPositioning[]; +UI_EXPORT extern const char kForceDeviceScaleFactor[]; UI_EXPORT extern const char kHighDPISupport[]; } // namespace switches -} // namespace gfx #endif // UI_GFX_SWITCHES_H_ diff --git a/ui/gfx/sys_color_change_listener.cc b/ui/gfx/sys_color_change_listener.cc index 7a9fc84..d5646b3 100644 --- a/ui/gfx/sys_color_change_listener.cc +++ b/ui/gfx/sys_color_change_listener.cc @@ -13,7 +13,7 @@ #include "base/memory/singleton.h" #include "base/observer_list.h" #if defined(OS_WIN) -#include "ui/base/win/singleton_hwnd.h" +#include "ui/gfx/win/singleton_hwnd.h" #endif namespace gfx { @@ -48,7 +48,7 @@ bool IsInvertedColorScheme() { } #if defined(OS_WIN) -class SysColorChangeObserver : public ui::SingletonHwnd::Observer { +class SysColorChangeObserver : public gfx::SingletonHwnd::Observer { public: static SysColorChangeObserver* GetInstance(); @@ -75,11 +75,11 @@ SysColorChangeObserver* SysColorChangeObserver::GetInstance() { } SysColorChangeObserver::SysColorChangeObserver() { - ui::SingletonHwnd::GetInstance()->AddObserver(this); + gfx::SingletonHwnd::GetInstance()->AddObserver(this); } SysColorChangeObserver::~SysColorChangeObserver() { - ui::SingletonHwnd::GetInstance()->RemoveObserver(this); + gfx::SingletonHwnd::GetInstance()->RemoveObserver(this); } void SysColorChangeObserver::AddListener(SysColorChangeListener* listener) { diff --git a/ui/base/text/utf16_indexing.cc b/ui/gfx/utf16_indexing.cc index d217f5d..6af10c1 100644 --- a/ui/base/text/utf16_indexing.cc +++ b/ui/gfx/utf16_indexing.cc @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/base/text/utf16_indexing.h" +#include "ui/gfx/utf16_indexing.h" #include "base/logging.h" #include "base/third_party/icu/icu_utf.h" -namespace ui { +namespace gfx { bool IsValidCodePointIndex(const string16& s, size_t index) { return index == 0 || index == s.length() || @@ -52,4 +52,4 @@ size_t UTF16OffsetToIndex(const string16& s, size_t base, ptrdiff_t offset) { return pos; } -} // namespace ui +} // namespace gfx diff --git a/ui/base/text/utf16_indexing.h b/ui/gfx/utf16_indexing.h index a1af3d9..7f56384 100644 --- a/ui/base/text/utf16_indexing.h +++ b/ui/gfx/utf16_indexing.h @@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_BASE_TEXT_UTF16_INDEXING_H_ -#define UI_BASE_TEXT_UTF16_INDEXING_H_ +#ifndef UI_GFX_UTF16_INDEXING_H_ +#define UI_GFX_UTF16_INDEXING_H_ #include "base/strings/string16.h" -#include "ui/base/ui_export.h" +#include "ui/gfx/gfx_export.h" -namespace ui { +namespace gfx { // Returns false if s[index-1] is a high surrogate and s[index] is a low // surrogate, true otherwise. @@ -44,6 +44,6 @@ UI_EXPORT size_t UTF16OffsetToIndex(const string16& s, size_t base, ptrdiff_t offset); -} // namespace ui +} // namespace gfx -#endif // UI_BASE_TEXT_UTF16_INDEXING_H_ +#endif // UI_GFX_UTF16_INDEXING_H_ diff --git a/ui/base/text/utf16_indexing_unittest.cc b/ui/gfx/utf16_indexing_unittest.cc index 1bf8c30..da2f8f5b 100644 --- a/ui/base/text/utf16_indexing_unittest.cc +++ b/ui/gfx/utf16_indexing_unittest.cc @@ -3,9 +3,9 @@ // found in the LICENSE file. #include "testing/gtest/include/gtest/gtest.h" -#include "ui/base/text/utf16_indexing.h" +#include "ui/gfx/utf16_indexing.h" -namespace ui { +namespace gfx { TEST(UTF16IndexingTest, IndexOffsetConversions) { // Valid surrogate pair surrounded by unpaired surrogates @@ -29,4 +29,4 @@ TEST(UTF16IndexingTest, IndexOffsetConversions) { } } -} // namespace ui +} // namespace gfx diff --git a/ui/gfx/dpi_win.cc b/ui/gfx/win/dpi.cc index 51972d2..98d23bd 100644 --- a/ui/gfx/dpi_win.cc +++ b/ui/gfx/win/dpi.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 "ui/gfx/dpi_win.h" +#include "ui/gfx/win/dpi.h" #include <windows.h> #include "base/command_line.h" @@ -25,9 +25,9 @@ int kDefaultDPIY = 96; bool IsHighDPIEnabled() { // Default is disabled. if (CommandLine::ForCurrentProcess()->HasSwitch( - gfx::switches::kHighDPISupport)) { + switches::kHighDPISupport)) { return CommandLine::ForCurrentProcess()->GetSwitchValueASCII( - gfx::switches::kHighDPISupport).compare("1") == 0; + switches::kHighDPISupport).compare("1") == 0; } return false; } diff --git a/ui/gfx/dpi_win.h b/ui/gfx/win/dpi.h index a056f53..a056f53 100644 --- a/ui/gfx/dpi_win.h +++ b/ui/gfx/win/dpi.h diff --git a/ui/base/win/hwnd_util.cc b/ui/gfx/win/hwnd_util.cc index 0a8dfb2..91f0ddd 100644 --- a/ui/base/win/hwnd_util.cc +++ b/ui/gfx/win/hwnd_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 "ui/base/win/hwnd_util.h" +#include "ui/gfx/win/hwnd_util.h" #include "base/i18n/rtl.h" #include "base/strings/string_util.h" @@ -12,7 +12,7 @@ #include "ui/gfx/rect.h" #include "ui/gfx/size.h" -namespace ui { +namespace gfx { namespace { @@ -25,9 +25,9 @@ void AdjustWindowToFit(HWND hwnd, const RECT& bounds, bool fit_to_monitor) { MONITORINFO mi; mi.cbSize = sizeof(mi); base::win::GetMonitorInfoWrapper(hmon, &mi); - gfx::Rect window_rect(bounds); - gfx::Rect monitor_rect(mi.rcWork); - gfx::Rect new_window_rect = window_rect; + Rect window_rect(bounds); + Rect monitor_rect(mi.rcWork); + Rect new_window_rect = window_rect; new_window_rect.AdjustToFit(monitor_rect); if (new_window_rect != window_rect) { // Window doesn't fit on monitor, move and possibly resize. @@ -115,7 +115,7 @@ bool DoesWindowBelongToActiveWindow(HWND window) { void CenterAndSizeWindow(HWND parent, HWND window, - const gfx::Size& pref) { + const Size& pref) { DCHECK(window && pref.width() > 0 && pref.height() > 0); // Calculate the ideal bounds. @@ -177,13 +177,13 @@ void CheckWindowCreated(HWND hwnd) { void ShowSystemMenu(HWND window) { RECT rect; GetWindowRect(window, &rect); - gfx::Point point = gfx::Point(rect.left, rect.top); + Point point = Point(rect.left, rect.top); static const int kSystemMenuOffset = 10; point.Offset(kSystemMenuOffset, kSystemMenuOffset); ShowSystemMenuAtPoint(window, point); } -void ShowSystemMenuAtPoint(HWND window, const gfx::Point& point) { +void ShowSystemMenuAtPoint(HWND window, const Point& point) { // In the Metro process, we never want to show the system menu. if (base::win::IsMetroProcess()) return; @@ -211,4 +211,4 @@ HWND GetWindowToParentTo(bool get_real_hwnd) { return root_window(); } -} // namespace ui +} // namespace gfx diff --git a/ui/base/win/hwnd_util.h b/ui/gfx/win/hwnd_util.h index ece1d3c..70e5f8f 100644 --- a/ui/base/win/hwnd_util.h +++ b/ui/gfx/win/hwnd_util.h @@ -2,20 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_BASE_WIN_HWND_UTIL_H_ -#define UI_BASE_WIN_HWND_UTIL_H_ +#ifndef UI_GFX_WIN_HWND_UTIL_H_ +#define UI_GFX_WIN_HWND_UTIL_H_ #include <windows.h> #include "base/strings/string16.h" -#include "ui/base/ui_export.h" +#include "ui/gfx/gfx_export.h" namespace gfx { class Point; class Size; -} - -namespace ui { // A version of the GetClassNameW API that returns the class name in an // string16. An empty result indicates a failure to get the class name. @@ -52,6 +49,6 @@ UI_EXPORT void ShowSystemMenuAtPoint(HWND window, const gfx::Point& point); // container so in those cases you should pass true in |get_real_hwnd|. UI_EXPORT HWND GetWindowToParentTo(bool get_real_hwnd); -} // namespace ui +} // namespace gfx -#endif // UI_BASE_WIN_HWND_UTIL_H_ +#endif // UI_GFX_WIN_HWND_UTIL_H_ diff --git a/ui/base/win/scoped_set_map_mode.h b/ui/gfx/win/scoped_set_map_mode.h index bf2b78d..910837d 100644 --- a/ui/base/win/scoped_set_map_mode.h +++ b/ui/gfx/win/scoped_set_map_mode.h @@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_BASE_WIN_SCOPED_SET_MAP_MODE_H_ -#define UI_BASE_WIN_SCOPED_SET_MAP_MODE_H_ +#ifndef UI_GFX_WIN_SCOPED_SET_MAP_MODE_H_ +#define UI_GFX_WIN_SCOPED_SET_MAP_MODE_H_ #include <windows.h> #include "base/basictypes.h" #include "base/logging.h" -namespace ui { +namespace gfx { // Helper class for setting and restore the map mode on a DC. class ScopedSetMapMode { @@ -35,6 +35,6 @@ class ScopedSetMapMode { DISALLOW_COPY_AND_ASSIGN(ScopedSetMapMode); }; -} // namespace ui +} // namespace gfx -#endif // UI_BASE_WIN_SCOPED_SET_MAP_MODE_H_ +#endif // UI_GFX_WIN_SCOPED_SET_MAP_MODE_H_ diff --git a/ui/base/win/singleton_hwnd.cc b/ui/gfx/win/singleton_hwnd.cc index 9d1685f..37993e8 100644 --- a/ui/base/win/singleton_hwnd.cc +++ b/ui/gfx/win/singleton_hwnd.cc @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/base/win/singleton_hwnd.h" +#include "ui/gfx/win/singleton_hwnd.h" #include "base/memory/singleton.h" #include "base/message_loop/message_loop.h" -namespace ui { +namespace gfx { // static SingletonHwnd* SingletonHwnd::GetInstance() { @@ -23,7 +23,7 @@ void SingletonHwnd::AddObserver(Observer* observer) { DLOG(ERROR) << "Cannot create windows on non-UI thread!"; return; } - WindowImpl::Init(NULL, gfx::Rect()); + WindowImpl::Init(NULL, Rect()); } observer_list_.AddObserver(observer); } @@ -52,4 +52,4 @@ SingletonHwnd::SingletonHwnd() { SingletonHwnd::~SingletonHwnd() { } -} // namespace ui +} // namespace gfx diff --git a/ui/base/win/singleton_hwnd.h b/ui/gfx/win/singleton_hwnd.h index a84b6c0..96af6e7 100644 --- a/ui/base/win/singleton_hwnd.h +++ b/ui/gfx/win/singleton_hwnd.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_BASE_WIN_SINGLETON_HWND_H_ -#define UI_BASE_WIN_SINGLETON_HWND_H_ +#ifndef UI_GFX_WIN_SINGLETON_HWND_H_ +#define UI_GFX_WIN_SINGLETON_HWND_H_ #include <windows.h> #include <vector> @@ -11,11 +11,11 @@ #include "base/basictypes.h" #include "base/callback_forward.h" #include "base/observer_list.h" -#include "ui/base/win/window_impl.h" +#include "ui/gfx/win/window_impl.h" template<typename T> struct DefaultSingletonTraits; -namespace ui { +namespace gfx { // Singleton message-only HWND that allows interested clients to receive WM_* // notifications. @@ -56,6 +56,6 @@ class SingletonHwnd : public WindowImpl { DISALLOW_COPY_AND_ASSIGN(SingletonHwnd); }; -} // namespace ui +} // namespace gfx -#endif // UI_BASE_WIN_SINGLETON_HWND_H_ +#endif // UI_GFX_WIN_SINGLETON_HWND_H_ diff --git a/ui/base/win/window_impl.cc b/ui/gfx/win/window_impl.cc index 22ed535..e2e6af0 100644 --- a/ui/base/win/window_impl.cc +++ b/ui/gfx/win/window_impl.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 "ui/base/win/window_impl.h" +#include "ui/gfx/win/window_impl.h" #include <list> @@ -11,9 +11,9 @@ #include "base/strings/string_number_conversions.h" #include "base/synchronization/lock.h" #include "base/win/wrapped_window_proc.h" -#include "ui/base/win/hwnd_util.h" +#include "ui/gfx/win/hwnd_util.h" -namespace ui { +namespace gfx { static const DWORD kWindowDefaultChildStyle = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS; @@ -149,7 +149,7 @@ WindowImpl::~WindowImpl() { ClearUserData(); } -void WindowImpl::Init(HWND parent, const gfx::Rect& bounds) { +void WindowImpl::Init(HWND parent, const Rect& bounds) { if (window_style_ == 0) window_style_ = parent ? kWindowDefaultChildStyle : kWindowDefaultStyle; @@ -216,7 +216,7 @@ void WindowImpl::Init(HWND parent, const gfx::Rect& bounds) { CheckWindowCreated(hwnd_); // The window procedure should have set the data for us. - CHECK_EQ(this, ui::GetWindowUserData(hwnd)); + CHECK_EQ(this, GetWindowUserData(hwnd)); } HICON WindowImpl::GetDefaultWindowIcon() const { @@ -236,7 +236,7 @@ LRESULT WindowImpl::OnWndProc(UINT message, WPARAM w_param, LPARAM l_param) { void WindowImpl::ClearUserData() { if (::IsWindow(hwnd_)) - ui::SetWindowUserData(hwnd_, NULL); + gfx::SetWindowUserData(hwnd_, NULL); } // static @@ -248,7 +248,7 @@ LRESULT CALLBACK WindowImpl::WndProc(HWND hwnd, CREATESTRUCT* cs = reinterpret_cast<CREATESTRUCT*>(l_param); WindowImpl* window = reinterpret_cast<WindowImpl*>(cs->lpCreateParams); DCHECK(window); - ui::SetWindowUserData(hwnd, window); + gfx::SetWindowUserData(hwnd, window); window->hwnd_ = hwnd; window->got_create_ = true; if (hwnd) @@ -256,8 +256,7 @@ LRESULT CALLBACK WindowImpl::WndProc(HWND hwnd, return TRUE; } - WindowImpl* window = reinterpret_cast<WindowImpl*>( - ui::GetWindowUserData(hwnd)); + WindowImpl* window = reinterpret_cast<WindowImpl*>(GetWindowUserData(hwnd)); if (!window) return 0; @@ -270,4 +269,4 @@ ATOM WindowImpl::GetWindowClassAtom() { return ClassRegistrar::GetInstance()->RetrieveClassAtom(class_info); } -} // namespace ui +} // namespace gfx diff --git a/ui/base/win/window_impl.h b/ui/gfx/win/window_impl.h index 1f3b5d3..2b0018e 100644 --- a/ui/base/win/window_impl.h +++ b/ui/gfx/win/window_impl.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_BASE_WIN_WINDOW_IMPL_H_ -#define UI_BASE_WIN_WINDOW_IMPL_H_ +#ifndef UI_GFX_WIN_WINDOW_IMPL_H_ +#define UI_GFX_WIN_WINDOW_IMPL_H_ #include <atlbase.h> #include <atlapp.h> @@ -13,11 +13,11 @@ #include <string> #include "base/logging.h" -#include "ui/base/ui_export.h" +#include "ui/gfx/gfx_export.h" #include "ui/gfx/native_widget_types.h" #include "ui/gfx/rect.h" -namespace ui { +namespace gfx { // An interface implemented by classes that use message maps. // ProcessWindowMessage is implemented by the BEGIN_MESSAGE_MAP_EX macro. @@ -118,6 +118,6 @@ class UI_EXPORT WindowImpl : public MessageMapInterface { DISALLOW_COPY_AND_ASSIGN(WindowImpl); }; -} // namespace ui +} // namespace gfx -#endif // UI_BASE_WIN_WINDOW_IMPL_H_ +#endif // UI_GFX_WIN_WINDOW_IMPL_H_ diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc index 79081b7..74b4f14 100644 --- a/ui/native_theme/native_theme_win.cc +++ b/ui/native_theme/native_theme_win.cc @@ -24,11 +24,11 @@ #include "third_party/skia/include/core/SkColorPriv.h" #include "third_party/skia/include/core/SkShader.h" #include "ui/gfx/color_utils.h" -#include "ui/gfx/dpi_win.h" #include "ui/gfx/gdi_util.h" #include "ui/gfx/rect.h" #include "ui/gfx/rect_conversions.h" #include "ui/gfx/sys_color_change_listener.h" +#include "ui/gfx/win/dpi.h" #include "ui/native_theme/common_theme.h" // This was removed from Winvers.h but is still used. diff --git a/ui/surface/accelerated_surface_win.cc b/ui/surface/accelerated_surface_win.cc index 502678b..3faf01d 100644 --- a/ui/surface/accelerated_surface_win.cc +++ b/ui/surface/accelerated_surface_win.cc @@ -26,10 +26,10 @@ #include "media/base/video_util.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/latency_info.h" -#include "ui/base/win/hwnd_util.h" #include "ui/base/win/shell.h" -#include "ui/gfx/dpi_win.h" #include "ui/gfx/rect.h" +#include "ui/gfx/win/dpi.h" +#include "ui/gfx/win/hwnd_util.h" #include "ui/gl/gl_switches.h" #include "ui/surface/accelerated_surface_transformer_win.h" #include "ui/surface/d3d9_utils_win.h" @@ -315,8 +315,6 @@ 'base/resource/resource_handle.h', 'base/text/bytes_formatting.cc', 'base/text/bytes_formatting.h', - 'base/text/utf16_indexing.cc', - 'base/text/utf16_indexing.h', 'base/theme_provider.cc', 'base/theme_provider.h', 'base/touch/touch_device.cc', @@ -355,23 +353,16 @@ 'base/win/hidden_window.h', 'base/win/hwnd_subclass.cc', 'base/win/hwnd_subclass.h', - 'base/win/hwnd_util.cc', - 'base/win/hwnd_util.h', 'base/win/message_box_win.cc', 'base/win/message_box_win.h', 'base/win/mouse_wheel_util.cc', 'base/win/mouse_wheel_util.h', 'base/win/scoped_ole_initializer.cc', 'base/win/scoped_ole_initializer.h', - 'base/win/scoped_set_map_mode.h', 'base/win/shell.cc', 'base/win/shell.h', - 'base/win/singleton_hwnd.cc', - 'base/win/singleton_hwnd.h', 'base/win/touch_input.cc', 'base/win/touch_input.h', - 'base/win/window_impl.cc', - 'base/win/window_impl.h', 'base/window_open_disposition.cc', 'base/window_open_disposition.h', 'base/work_area_watcher_observer.h', @@ -435,8 +426,6 @@ 'gfx/display.h', 'gfx/display_observer.cc', 'gfx/display_observer.h', - 'gfx/dpi_win.cc', - 'gfx/dpi_win.h', 'gfx/favicon_size.cc', 'gfx/favicon_size.h', 'gfx/font.cc', @@ -591,6 +580,8 @@ 'gfx/transform.h', 'gfx/transform_util.cc', 'gfx/transform_util.h', + 'gfx/utf16_indexing.cc', + 'gfx/utf16_indexing.h', 'gfx/vector2d.cc', 'gfx/vector2d.h', 'gfx/vector2d_conversions.cc', @@ -599,6 +590,15 @@ 'gfx/vector2d_f.h', 'gfx/vector3d_f.cc', 'gfx/vector3d_f.h', + 'gfx/win/dpi.cc', + 'gfx/win/dpi.h', + 'gfx/win/hwnd_util.cc', + 'gfx/win/hwnd_util.h', + 'gfx/win/scoped_set_map_mode.h', + 'gfx/win/singleton_hwnd.cc', + 'gfx/win/singleton_hwnd.h', + 'gfx/win/window_impl.cc', + 'gfx/win/window_impl.h', 'webui/jstemplate_builder.cc', 'webui/jstemplate_builder.h', 'webui/web_ui_util.cc', diff --git a/ui/ui_unittests.gypi b/ui/ui_unittests.gypi index 8c9771b..28e89645 100644 --- a/ui/ui_unittests.gypi +++ b/ui/ui_unittests.gypi @@ -165,7 +165,6 @@ 'base/ozone/evdev/touch_event_converter_ozone_unittest.cc', 'base/test/data/resource.h', 'base/text/bytes_formatting_unittest.cc', - 'base/text/utf16_indexing_unittest.cc', 'base/view_prop_unittest.cc', 'gfx/blit_unittest.cc', 'gfx/break_list_unittest.cc', @@ -178,6 +177,7 @@ 'gfx/platform_font_mac_unittest.mm', 'gfx/render_text_unittest.cc', 'gfx/transform_util_unittest.cc', + 'gfx/utf16_indexing_unittest.cc', 'shell_dialogs/select_file_dialog_win_unittest.cc', 'webui/web_ui_util_unittest.cc', ], diff --git a/ui/views/controls/combobox/native_combobox_win.cc b/ui/views/controls/combobox/native_combobox_win.cc index 3093c53..a810d85 100644 --- a/ui/views/controls/combobox/native_combobox_win.cc +++ b/ui/views/controls/combobox/native_combobox_win.cc @@ -9,8 +9,8 @@ #include "ui/base/events/event.h" #include "ui/base/models/combobox_model.h" #include "ui/base/resource/resource_bundle.h" -#include "ui/base/win/hwnd_util.h" #include "ui/gfx/font.h" +#include "ui/gfx/win/hwnd_util.h" #include "ui/native_theme/native_theme_win.h" #include "ui/views/controls/combobox/combobox.h" #include "ui/views/controls/combobox/native_combobox_views.h" @@ -188,7 +188,7 @@ void NativeComboboxWin::CreateNativeControl() { flags, 0, 0, width(), height(), GetWidget()->GetNativeView(), NULL, NULL, NULL); - ui::CheckWindowCreated(control_hwnd); + gfx::CheckWindowCreated(control_hwnd); NativeControlCreated(control_hwnd); } diff --git a/ui/views/controls/menu/menu_win.cc b/ui/views/controls/menu/menu_win.cc index 3ff01b8..d75402b 100644 --- a/ui/views/controls/menu/menu_win.cc +++ b/ui/views/controls/menu/menu_win.cc @@ -13,10 +13,10 @@ #include "ui/base/keycodes/keyboard_codes.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util_win.h" -#include "ui/base/win/window_impl.h" #include "ui/gfx/canvas.h" #include "ui/gfx/font.h" #include "ui/gfx/rect.h" +#include "ui/gfx/win/window_impl.h" namespace views { @@ -62,7 +62,7 @@ static int ChromeGetMenuItemID(HMENU hMenu, int pos) { // to intercept right clicks on the HMENU and notify the delegate as well as // for drawing icons. // -class MenuHostWindow : public ui::WindowImpl { +class MenuHostWindow : public gfx::WindowImpl { public: MenuHostWindow(MenuWin* menu, HWND parent_window) : menu_(menu) { int extended_style = 0; diff --git a/ui/views/controls/menu/native_menu_win.cc b/ui/views/controls/menu/native_menu_win.cc index e357b1e..10ff3a3 100644 --- a/ui/views/controls/menu/native_menu_win.cc +++ b/ui/views/controls/menu/native_menu_win.cc @@ -17,12 +17,12 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util_win.h" #include "ui/base/models/menu_model.h" -#include "ui/base/win/hwnd_util.h" #include "ui/gfx/canvas.h" #include "ui/gfx/font.h" #include "ui/gfx/image/image.h" #include "ui/gfx/image/image_skia.h" #include "ui/gfx/rect.h" +#include "ui/gfx/win/hwnd_util.h" #include "ui/native_theme/native_theme.h" #include "ui/native_theme/native_theme_win.h" #include "ui/views/controls/menu/menu_2.h" @@ -81,8 +81,8 @@ class NativeMenuWin::MenuHostWindow { RegisterClass(); hwnd_ = CreateWindowEx(l10n_util::GetExtendedStyles(), kWindowClassName, L"", 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL); - ui::CheckWindowCreated(hwnd_); - ui::SetWindowUserData(hwnd_, this); + gfx::CheckWindowCreated(hwnd_); + gfx::SetWindowUserData(hwnd_, this); } ~MenuHostWindow() { @@ -350,7 +350,7 @@ class NativeMenuWin::MenuHostWindow { WPARAM w_param, LPARAM l_param) { MenuHostWindow* host = - reinterpret_cast<MenuHostWindow*>(ui::GetWindowUserData(window)); + reinterpret_cast<MenuHostWindow*>(gfx::GetWindowUserData(window)); // host is null during initial construction. LRESULT l_result = 0; if (!host || !host->ProcessWindowMessage(window, message, w_param, l_param, diff --git a/ui/views/controls/native/native_view_host_win.cc b/ui/views/controls/native/native_view_host_win.cc index da71d06..e7b74c3 100644 --- a/ui/views/controls/native/native_view_host_win.cc +++ b/ui/views/controls/native/native_view_host_win.cc @@ -8,9 +8,9 @@ #include "base/logging.h" #include "ui/base/win/hidden_window.h" -#include "ui/base/win/window_impl.h" #include "ui/gfx/canvas.h" -#include "ui/gfx/dpi_win.h" +#include "ui/gfx/win/dpi.h" +#include "ui/gfx/win/window_impl.h" #include "ui/views/controls/native/native_view_host.h" #include "ui/views/focus/focus_manager.h" #include "ui/views/widget/native_widget.h" diff --git a/ui/views/controls/native_control.cc b/ui/views/controls/native_control.cc index e6219e7..e450463 100644 --- a/ui/views/controls/native_control.cc +++ b/ui/views/controls/native_control.cc @@ -17,7 +17,7 @@ #include "ui/base/keycodes/keyboard_codes.h" #include "ui/base/l10n/l10n_util_win.h" #include "ui/base/view_prop.h" -#include "ui/base/win/hwnd_util.h" +#include "ui/gfx/win/hwnd_util.h" #include "ui/views/background.h" #include "ui/views/controls/native/native_view_host.h" #include "ui/views/focus/focus_manager.h" @@ -88,7 +88,7 @@ class NativeControlContainer : public CWindowImpl<NativeControlContainer, control_ = parent_->CreateNativeControl(m_hWnd); // We subclass the control hwnd so we get the WM_KEYDOWN messages. - original_handler_ = ui::SetWindowProc( + original_handler_ = gfx::SetWindowProc( control_, &NativeControl::NativeControlWndProc); prop_.reset(new ViewProp(control_, kNativeControlKey , parent_)); @@ -378,7 +378,7 @@ LRESULT CALLBACK NativeControl::NativeControlWndProc(HWND window, NOTREACHED(); } } else if (message == WM_DESTROY) { - ui::SetWindowProc(window, reinterpret_cast<WNDPROC>(original_handler)); + gfx::SetWindowProc(window, reinterpret_cast<WNDPROC>(original_handler)); native_control->container_->prop_.reset(); } diff --git a/ui/views/controls/native_control_win.cc b/ui/views/controls/native_control_win.cc index 2b6c6d4..c50411d 100644 --- a/ui/views/controls/native_control_win.cc +++ b/ui/views/controls/native_control_win.cc @@ -10,7 +10,7 @@ #include "ui/base/accessibility/accessibility_types.h" #include "ui/base/l10n/l10n_util_win.h" #include "ui/base/view_prop.h" -#include "ui/base/win/hwnd_util.h" +#include "ui/gfx/win/hwnd_util.h" #include "ui/views/controls/combobox/combobox.h" #include "ui/views/focus/focus_manager.h" #include "ui/views/widget/widget.h" @@ -139,7 +139,7 @@ void NativeControlWin::NativeControlCreated(HWND native_control) { props_.push_back(ChildWindowMessageProcessor::Register(native_control, this)); // Subclass so we get WM_KEYDOWN and WM_SETFOCUS messages. - original_wndproc_ = ui::SetWindowProc( + original_wndproc_ = gfx::SetWindowProc( native_control, &NativeControlWin::NativeControlWndProc); Attach(native_control); @@ -216,7 +216,7 @@ LRESULT NativeControlWin::NativeControlWndProc(HWND window, } } else if (message == WM_DESTROY) { native_control->props_.clear(); - ui::SetWindowProc(window, native_control->original_wndproc_); + gfx::SetWindowProc(window, native_control->original_wndproc_); } return CallWindowProc(native_control->original_wndproc_, window, message, diff --git a/ui/views/controls/textfield/native_textfield_win.cc b/ui/views/controls/textfield/native_textfield_win.cc index c96f3cb..99cf074 100644 --- a/ui/views/controls/textfield/native_textfield_win.cc +++ b/ui/views/controls/textfield/native_textfield_win.cc @@ -22,9 +22,9 @@ #include "ui/base/keycodes/keyboard_codes.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util_win.h" -#include "ui/base/win/hwnd_util.h" #include "ui/base/win/mouse_wheel_util.h" #include "ui/gfx/range/range.h" +#include "ui/gfx/win/hwnd_util.h" #include "ui/native_theme/native_theme_win.h" #include "ui/views/controls/label.h" #include "ui/views/controls/menu/menu_item_view.h" @@ -1103,7 +1103,7 @@ void NativeTextfieldWin::OnSysChar(TCHAR ch, UINT repeat_count, UINT flags) { // something useful, so discard those. Note that [Ctrl]+[Alt]+<xxx> generates // WM_CHAR instead of WM_SYSCHAR, so it is not handled here. if (ch == VK_SPACE) { - ui::ShowSystemMenu( + gfx::ShowSystemMenu( container_view_->GetWidget()->GetTopLevelWidget()->GetNativeWindow()); } } diff --git a/ui/views/controls/textfield/textfield_views_model.cc b/ui/views/controls/textfield/textfield_views_model.cc index 4db0c75..dae5684 100644 --- a/ui/views/controls/textfield/textfield_views_model.cc +++ b/ui/views/controls/textfield/textfield_views_model.cc @@ -12,12 +12,12 @@ #include "base/strings/utf_string_conversions.h" #include "ui/base/clipboard/clipboard.h" #include "ui/base/clipboard/scoped_clipboard_writer.h" -#include "ui/base/text/utf16_indexing.h" #include "ui/gfx/canvas.h" #include "ui/gfx/font.h" #include "ui/gfx/range/range.h" #include "ui/gfx/render_text.h" #include "ui/gfx/text_constants.h" +#include "ui/gfx/utf16_indexing.h" #include "ui/views/controls/textfield/textfield.h" namespace views { @@ -384,7 +384,7 @@ bool TextfieldViewsModel::Backspace() { if (cursor_position > 0) { // Delete one code point, which may be two UTF-16 words. size_t previous_char = - ui::UTF16OffsetToIndex(GetText(), cursor_position, -1); + gfx::UTF16OffsetToIndex(GetText(), cursor_position, -1); ExecuteAndRecordDelete(gfx::Range(cursor_position, previous_char), true); return true; } diff --git a/ui/views/widget/aero_tooltip_manager.cc b/ui/views/widget/aero_tooltip_manager.cc index 504ae48..c54124c 100644 --- a/ui/views/widget/aero_tooltip_manager.cc +++ b/ui/views/widget/aero_tooltip_manager.cc @@ -11,9 +11,9 @@ #include "base/bind.h" #include "base/message_loop/message_loop.h" #include "ui/base/l10n/l10n_util_win.h" -#include "ui/base/win/hwnd_util.h" -#include "ui/gfx/dpi_win.h" #include "ui/gfx/point.h" +#include "ui/gfx/win/dpi.h" +#include "ui/gfx/win/hwnd_util.h" namespace views { diff --git a/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc b/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc index b9915ba..8f6720a 100644 --- a/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc +++ b/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc @@ -16,10 +16,10 @@ #include "ui/base/ime/input_method.h" #include "ui/base/ime/win/tsf_bridge.h" #include "ui/base/win/shell.h" -#include "ui/gfx/dpi_win.h" #include "ui/gfx/insets.h" #include "ui/gfx/native_widget_types.h" #include "ui/gfx/path_win.h" +#include "ui/gfx/win/dpi.h" #include "ui/native_theme/native_theme_aura.h" #include "ui/native_theme/native_theme_win.h" #include "ui/views/corewm/compound_event_filter.h" diff --git a/ui/views/widget/native_widget_win.cc b/ui/views/widget/native_widget_win.cc index ebfa66f..87d75cf 100644 --- a/ui/views/widget/native_widget_win.cc +++ b/ui/views/widget/native_widget_win.cc @@ -24,16 +24,16 @@ #include "ui/base/l10n/l10n_util_win.h" #include "ui/base/theme_provider.h" #include "ui/base/view_prop.h" -#include "ui/base/win/hwnd_util.h" #include "ui/base/win/mouse_wheel_util.h" #include "ui/base/win/shell.h" #include "ui/gfx/canvas.h" #include "ui/gfx/canvas_skia_paint.h" -#include "ui/gfx/dpi_win.h" #include "ui/gfx/path.h" #include "ui/gfx/point_conversions.h" #include "ui/gfx/screen.h" #include "ui/gfx/size_conversions.h" +#include "ui/gfx/win/dpi.h" +#include "ui/gfx/win/hwnd_util.h" #include "ui/native_theme/native_theme.h" #include "ui/views/controls/native_control_win.h" #include "ui/views/controls/textfield/textfield.h" diff --git a/ui/views/widget/native_widget_win.h b/ui/views/widget/native_widget_win.h index bc24630..cadc6fd 100644 --- a/ui/views/widget/native_widget_win.h +++ b/ui/views/widget/native_widget_win.h @@ -11,7 +11,7 @@ #include "base/memory/scoped_vector.h" #include "base/win/scoped_comptr.h" #include "base/win/win_util.h" -#include "ui/base/win/window_impl.h" +#include "ui/gfx/win/window_impl.h" #include "ui/views/widget/native_widget_private.h" #include "ui/views/win/hwnd_message_handler_delegate.h" diff --git a/ui/views/widget/tooltip_manager_win.cc b/ui/views/widget/tooltip_manager_win.cc index 4c0a241..362ff33 100644 --- a/ui/views/widget/tooltip_manager_win.cc +++ b/ui/views/widget/tooltip_manager_win.cc @@ -16,11 +16,11 @@ #include "base/win/scoped_hdc.h" #include "base/win/scoped_select_object.h" #include "ui/base/l10n/l10n_util_win.h" -#include "ui/base/win/hwnd_util.h" -#include "ui/base/win/scoped_set_map_mode.h" -#include "ui/gfx/dpi_win.h" #include "ui/gfx/font_list.h" #include "ui/gfx/screen.h" +#include "ui/gfx/win/dpi.h" +#include "ui/gfx/win/hwnd_util.h" +#include "ui/gfx/win/scoped_set_map_mode.h" #include "ui/views/view.h" #include "ui/views/widget/monitor_win.h" #include "ui/views/widget/widget.h" @@ -257,7 +257,7 @@ int TooltipManagerWin::CalcTooltipHeight() { if (hfont != NULL) { base::win::ScopedGetDC dc(tooltip_hwnd_); base::win::ScopedSelectObject font(dc, hfont); - ui::ScopedSetMapMode mode(dc, MM_TEXT); + gfx::ScopedSetMapMode mode(dc, MM_TEXT); TEXTMETRIC font_metrics; GetTextMetrics(dc, &font_metrics); height = font_metrics.tmHeight; diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc index d2a6804..e8823f2 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc @@ -16,18 +16,18 @@ #include "ui/base/gestures/gesture_sequence.h" #include "ui/base/keycodes/keyboard_code_conversion_win.h" #include "ui/base/touch/touch_enabled.h" -#include "ui/base/win/hwnd_util.h" #include "ui/base/win/mouse_wheel_util.h" #include "ui/base/win/shell.h" #include "ui/base/win/touch_input.h" #include "ui/gfx/canvas.h" #include "ui/gfx/canvas_skia_paint.h" -#include "ui/gfx/dpi_win.h" #include "ui/gfx/icon_util.h" #include "ui/gfx/insets.h" #include "ui/gfx/path.h" #include "ui/gfx/path_win.h" #include "ui/gfx/screen.h" +#include "ui/gfx/win/dpi.h" +#include "ui/gfx/win/hwnd_util.h" #include "ui/native_theme/native_theme_win.h" #include "ui/views/views_delegate.h" #include "ui/views/widget/monitor_win.h" @@ -543,7 +543,7 @@ void HWNDMessageHandler::CenterWindow(const gfx::Size& size) { HWND parent = GetParent(hwnd()); if (!IsWindow(hwnd())) parent = ::GetWindow(hwnd(), GW_OWNER); - ui::CenterAndSizeWindow(parent, hwnd(), size); + gfx::CenterAndSizeWindow(parent, hwnd(), size); } void HWNDMessageHandler::SetRegion(HRGN region) { @@ -844,7 +844,7 @@ void HWNDMessageHandler::DispatchKeyEventPostIME(const ui::KeyEvent& key) { } //////////////////////////////////////////////////////////////////////////////// -// HWNDMessageHandler, ui::WindowImpl overrides: +// HWNDMessageHandler, gfx::WindowImpl overrides: HICON HWNDMessageHandler::GetDefaultWindowIcon() const { if (use_system_default_icon_) @@ -1526,7 +1526,7 @@ LRESULT HWNDMessageHandler::OnMouseRange(UINT message, w_param = SendMessage(hwnd(), WM_NCHITTEST, 0, MAKELPARAM(screen_point.x, screen_point.y)); if (w_param == HTCAPTION || w_param == HTSYSMENU) { - ui::ShowSystemMenuAtPoint(hwnd(), gfx::Point(screen_point)); + gfx::ShowSystemMenuAtPoint(hwnd(), gfx::Point(screen_point)); return 0; } } else if (message == WM_NCLBUTTONDOWN && delegate_->IsUsingCustomFrame()) { diff --git a/ui/views/win/hwnd_message_handler.h b/ui/views/win/hwnd_message_handler.h index 86b8f2e..462a937 100644 --- a/ui/views/win/hwnd_message_handler.h +++ b/ui/views/win/hwnd_message_handler.h @@ -23,8 +23,8 @@ #include "ui/base/accessibility/accessibility_types.h" #include "ui/base/events/event.h" #include "ui/base/ui_base_types.h" -#include "ui/base/win/window_impl.h" #include "ui/gfx/rect.h" +#include "ui/gfx/win/window_impl.h" #include "ui/views/ime/input_method_delegate.h" #include "ui/views/views_export.h" @@ -58,7 +58,7 @@ const int WM_NCUAHDRAWFRAME = 0xAF; // implementation. // TODO(beng): This object should eventually *become* the WindowImpl. class VIEWS_EXPORT HWNDMessageHandler : - public ui::WindowImpl, + public gfx::WindowImpl, public internal::InputMethodDelegate, public base::MessageLoopForUI::Observer { public: |