diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-11 23:17:36 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-11 23:17:36 +0000 |
commit | b022f3639b133d47fad75ae9419061680369064e (patch) | |
tree | cc731aad202dcce650ea563097a02af468dc9e0e | |
parent | a17930d85c1a30bcb97c793ba08d2e6ea019deb6 (diff) | |
download | chromium_src-b022f3639b133d47fad75ae9419061680369064e.zip chromium_src-b022f3639b133d47fad75ae9419061680369064e.tar.gz chromium_src-b022f3639b133d47fad75ae9419061680369064e.tar.bz2 |
Rename Widgetwin->NativeWidgetWin
BUG=72040
TEST=none
TBR=sky
Review URL: http://codereview.chromium.org/6510001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74693 0039d316-1c4b-4281-b951-d872f2087c98
52 files changed, 395 insertions, 399 deletions
diff --git a/chrome/browser/accessibility/browser_views_accessibility_browsertest.cc b/chrome/browser/accessibility/browser_views_accessibility_browsertest.cc index 85f59a3..e03e22e 100644 --- a/chrome/browser/accessibility/browser_views_accessibility_browsertest.cc +++ b/chrome/browser/accessibility/browser_views_accessibility_browsertest.cc @@ -20,7 +20,6 @@ #include "ui/base/l10n/l10n_util.h" #include "views/accessibility/view_accessibility.h" #include "views/widget/root_view.h" -#include "views/widget/widget_win.h" #include "views/window/window.h" namespace { diff --git a/chrome/browser/aeropeek_manager.cc b/chrome/browser/aeropeek_manager.cc index b42a359..ce96082 100644 --- a/chrome/browser/aeropeek_manager.cc +++ b/chrome/browser/aeropeek_manager.cc @@ -36,7 +36,7 @@ #include "ui/base/win/window_impl.h" #include "ui/gfx/gdi_util.h" #include "ui/gfx/icon_util.h" -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" namespace { @@ -1016,7 +1016,7 @@ bool AeroPeekManager::Enabled() { // flooding users with tab thumbnails. const CommandLine* command_line = CommandLine::ForCurrentProcess(); return base::win::GetVersion() >= base::win::VERSION_WIN7 && - views::WidgetWin::IsAeroGlassEnabled() && + views::NativeWidgetWin::IsAeroGlassEnabled() && !command_line->HasSwitch(switches::kApp) && command_line->HasSwitch(switches::kEnableAeroPeekTabs); } diff --git a/chrome/browser/automation/automation_provider_win.cc b/chrome/browser/automation/automation_provider_win.cc index e0f76c9..64aacc6 100644 --- a/chrome/browser/automation/automation_provider_win.cc +++ b/chrome/browser/automation/automation_provider_win.cc @@ -26,7 +26,6 @@ #include "ui/base/keycodes/keyboard_codes.h" #include "views/focus/accelerator_handler.h" #include "views/widget/root_view.h" -#include "views/widget/widget_win.h" #include "views/window/window.h" // This task just adds another task to the event queue. This is useful if diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc index d5f7a7c..499bde3 100644 --- a/chrome/browser/external_tab_container_win.cc +++ b/chrome/browser/external_tab_container_win.cc @@ -134,7 +134,7 @@ bool ExternalTabContainer::Init(Profile* profile, route_all_top_level_navigations_ = route_all_top_level_navigations; set_window_style(WS_POPUP | WS_CLIPCHILDREN); - views::WidgetWin::Init(NULL, bounds); + views::NativeWidgetWin::Init(NULL, bounds); if (!IsWindow()) { NOTREACHED(); return false; @@ -798,10 +798,10 @@ void ExternalTabContainer::Observe(NotificationType type, } //////////////////////////////////////////////////////////////////////////////// -// ExternalTabContainer, views::WidgetWin overrides: +// ExternalTabContainer, views::NativeWidgetWin overrides: LRESULT ExternalTabContainer::OnCreate(LPCREATESTRUCT create_struct) { - LRESULT result = views::WidgetWin::OnCreate(create_struct); + LRESULT result = views::NativeWidgetWin::OnCreate(create_struct); if (result == 0) { // Grab a reference here which will be released in OnFinalMessage AddRef(); @@ -812,7 +812,7 @@ LRESULT ExternalTabContainer::OnCreate(LPCREATESTRUCT create_struct) { void ExternalTabContainer::OnDestroy() { prop_.reset(); Uninitialize(); - WidgetWin::OnDestroy(); + NativeWidgetWin::OnDestroy(); if (browser_.get()) { ::DestroyWindow(browser_->window()->GetNativeHandle()); } diff --git a/chrome/browser/external_tab_container_win.h b/chrome/browser/external_tab_container_win.h index 63a5958..e8b0e2b 100644 --- a/chrome/browser/external_tab_container_win.h +++ b/chrome/browser/external_tab_container_win.h @@ -22,7 +22,7 @@ #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" #include "views/accelerator.h" -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" class AutomationProvider; class Browser; @@ -42,7 +42,7 @@ class ViewProp; // TabContents as well as an implementation of TabContentsDelegate. class ExternalTabContainer : public TabContentsDelegate, public NotificationObserver, - public views::WidgetWin, + public views::NativeWidgetWin, public base::RefCounted<ExternalTabContainer>, public views::AcceleratorTarget, public InfoBarContainer::Delegate, @@ -192,7 +192,7 @@ class ExternalTabContainer : public TabContentsDelegate, void SetEnableExtensionAutomation( const std::vector<std::string>& functions_enabled); - // Overridden from views::WidgetWin: + // Overridden from views::NativeWidgetWin: virtual views::Window* GetWindow(); // Handles the specified |accelerator| being pressed. @@ -217,7 +217,7 @@ class ExternalTabContainer : public TabContentsDelegate, protected: ~ExternalTabContainer(); - // Overridden from views::WidgetWin: + // Overridden from views::NativeWidgetWin: virtual LRESULT OnCreate(LPCREATESTRUCT create_struct); virtual void OnDestroy(); virtual void OnFinalMessage(HWND window); diff --git a/chrome/browser/first_run/first_run_win.cc b/chrome/browser/first_run/first_run_win.cc index 4f3fe85..8bd302f 100644 --- a/chrome/browser/first_run/first_run_win.cc +++ b/chrome/browser/first_run/first_run_win.cc @@ -52,8 +52,8 @@ #include "views/focus/accelerator_handler.h" #include "views/layout/grid_layout.h" #include "views/layout/layout_constants.h" +#include "views/widget/native_widget_win.h" #include "views/widget/root_view.h" -#include "views/widget/widget_win.h" #include "views/window/window.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/l10n/l10n_util.h" @@ -631,7 +631,7 @@ class TryChromeDialog : public views::ButtonListener, // An approximate window size. After Layout() we'll get better bounds. gfx::Rect pos(310, 160); - views::WidgetWin* popup = new views::WidgetWin(); + views::NativeWidgetWin* popup = new views::NativeWidgetWin; if (!popup) { NOTREACHED(); return Upgrade::TD_DIALOG_ERROR; @@ -848,7 +848,7 @@ class TryChromeDialog : public views::ButtonListener, // We don't own any of this pointers. The |popup_| owns itself and owns // the other views. - views::WidgetWin* popup_; + views::NativeWidgetWin* popup_; views::RadioButton* try_chrome_; views::RadioButton* kill_chrome_; Upgrade::TryResult result_; 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 896862b..8021bcd 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_win.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc @@ -46,7 +46,7 @@ #include "views/focus/focus_manager.h" #include "views/focus/focus_util_win.h" // Included for views::kReflectedMessage - TODO(beng): move this to win_util.h! -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" #include "webkit/glue/webaccessibility.h" #include "webkit/glue/webcursor.h" #include "webkit/plugins/npapi/plugin_constants_win.h" diff --git a/chrome/browser/themes/browser_theme_provider.cc b/chrome/browser/themes/browser_theme_provider.cc index 87a73aa..19599a4 100644 --- a/chrome/browser/themes/browser_theme_provider.cc +++ b/chrome/browser/themes/browser_theme_provider.cc @@ -20,7 +20,7 @@ #include "ui/base/resource/resource_bundle.h" #if defined(OS_WIN) -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" #endif // Strings used in alignment properties. @@ -255,7 +255,7 @@ bool BrowserThemeProvider::ShouldUseNativeFrame() const { if (HasCustomImage(IDR_THEME_FRAME)) return false; #if defined(OS_WIN) - return views::WidgetWin::IsAeroGlassEnabled(); + return views::NativeWidgetWin::IsAeroGlassEnabled(); #else return false; #endif diff --git a/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc b/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc index e507df5..246019d 100644 --- a/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc +++ b/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc @@ -43,7 +43,7 @@ #include <objidl.h> #include "base/win/scoped_gdi_object.h" -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" #endif #if defined(OS_LINUX) @@ -1103,7 +1103,7 @@ void AutocompletePopupContentsView::MakeContentsPath( void AutocompletePopupContentsView::UpdateBlurRegion() { #if defined(OS_WIN) // We only support background blurring on Vista with Aero-Glass enabled. - if (!views::WidgetWin::IsAeroGlassEnabled() || !GetWidget()) + if (!views::NativeWidgetWin::IsAeroGlassEnabled() || !GetWidget()) return; // Provide a blurred background effect within the contents region of the diff --git a/chrome/browser/ui/views/autocomplete/autocomplete_popup_win.cc b/chrome/browser/ui/views/autocomplete/autocomplete_popup_win.cc index da76989..696fc8e 100644 --- a/chrome/browser/ui/views/autocomplete/autocomplete_popup_win.cc +++ b/chrome/browser/ui/views/autocomplete/autocomplete_popup_win.cc @@ -18,8 +18,8 @@ AutocompletePopupWin::AutocompletePopupWin( // Create the popup. set_window_style(WS_POPUP | WS_CLIPCHILDREN); set_window_ex_style(WS_EX_TOOLWINDOW | WS_EX_LAYERED); - WidgetWin::Init(GetAncestor(edit_view->GetNativeView(), GA_ROOT), - contents->GetPopupBounds()); + NativeWidgetWin::Init(GetAncestor(edit_view->GetNativeView(), GA_ROOT), + contents->GetPopupBounds()); // The contents is owned by the LocationBarView. contents->set_parent_owned(false); SetContentsView(contents); diff --git a/chrome/browser/ui/views/autocomplete/autocomplete_popup_win.h b/chrome/browser/ui/views/autocomplete/autocomplete_popup_win.h index bcb7af4..58732b8 100644 --- a/chrome/browser/ui/views/autocomplete/autocomplete_popup_win.h +++ b/chrome/browser/ui/views/autocomplete/autocomplete_popup_win.h @@ -7,13 +7,13 @@ #pragma once #include "base/weak_ptr.h" -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" class AutocompleteEditView; class AutocompletePopupContentsView; class AutocompletePopupWin - : public views::WidgetWin, + : public views::NativeWidgetWin, public base::SupportsWeakPtr<AutocompletePopupWin> { public: // Creates the popup and shows it. |edit_view| is the edit that created us. @@ -22,7 +22,7 @@ class AutocompletePopupWin virtual ~AutocompletePopupWin(); private: - // Overridden from WidgetWin: + // Overridden from NativeWidgetWin: virtual LRESULT OnMouseActivate(HWND window, UINT hit_test, UINT mouse_message); diff --git a/chrome/browser/ui/views/browser_bubble_win.cc b/chrome/browser/ui/views/browser_bubble_win.cc index 7e7f179..8f85c2c 100644 --- a/chrome/browser/ui/views/browser_bubble_win.cc +++ b/chrome/browser/ui/views/browser_bubble_win.cc @@ -5,11 +5,11 @@ #include "chrome/browser/ui/views/browser_bubble.h" #include "chrome/browser/ui/views/frame/browser_view.h" +#include "views/widget/native_widget_win.h" #include "views/widget/root_view.h" -#include "views/widget/widget_win.h" #include "views/window/window.h" -class BubbleWidget : public views::WidgetWin { +class BubbleWidget : public views::NativeWidgetWin { public: explicit BubbleWidget(BrowserBubble* bubble) : bubble_(bubble) { @@ -21,7 +21,7 @@ class BubbleWidget : public views::WidgetWin { if (activate) ShowWindow(SW_SHOW); else - views::WidgetWin::Show(); + views::NativeWidgetWin::Show(); } void Close() { @@ -32,7 +32,7 @@ class BubbleWidget : public views::WidgetWin { if (delegate) delegate->BubbleLostFocus(bubble_, NULL); } - views::WidgetWin::Close(); + views::NativeWidgetWin::Close(); bubble_ = NULL; } @@ -42,11 +42,11 @@ class BubbleWidget : public views::WidgetWin { if (delegate) delegate->BubbleLostFocus(bubble_, NULL); } - views::WidgetWin::Hide(); + views::NativeWidgetWin::Hide(); } void OnActivate(UINT action, BOOL minimized, HWND window) { - WidgetWin::OnActivate(action, minimized, window); + NativeWidgetWin::OnActivate(action, minimized, window); if (!bubble_) return; @@ -82,7 +82,7 @@ class BubbleWidget : public views::WidgetWin { } virtual void OnSetFocus(HWND focused_window) { - WidgetWin::OnSetFocus(focused_window); + NativeWidgetWin::OnSetFocus(focused_window); if (bubble_ && bubble_->delegate()) bubble_->delegate()->BubbleGotFocus(bubble_); } @@ -94,9 +94,9 @@ class BubbleWidget : public views::WidgetWin { }; void BrowserBubble::InitPopup() { - // popup_ is a Widget, but we need to do some WidgetWin stuff first, then - // we'll assign it into popup_. - views::WidgetWin* pop = new BubbleWidget(this); + // popup_ is a Widget, but we need to do some NativeWidgetWin stuff first, + // then we'll assign it into popup_. + views::NativeWidgetWin* pop = new BubbleWidget(this); // Enable the drop-shadow through the native windows drop-shadow support. if (drop_shadow_enabled_) @@ -111,7 +111,7 @@ void BrowserBubble::InitPopup() { } void BrowserBubble::MovePopup(int x, int y, int w, int h) { - views::WidgetWin* pop = static_cast<views::WidgetWin*>(popup_); + views::NativeWidgetWin* pop = static_cast<views::NativeWidgetWin*>(popup_); pop->SetBounds(gfx::Rect(x, y, w, h)); } @@ -126,7 +126,7 @@ void BrowserBubble::Show(bool activate) { void BrowserBubble::Hide() { if (!visible_) return; - views::WidgetWin* pop = static_cast<views::WidgetWin*>(popup_); + views::NativeWidgetWin* pop = static_cast<views::NativeWidgetWin*>(popup_); pop->Hide(); visible_ = false; } diff --git a/chrome/browser/ui/views/collected_cookies_win.cc b/chrome/browser/ui/views/collected_cookies_win.cc index 5c7e45e..3ba583c 100644 --- a/chrome/browser/ui/views/collected_cookies_win.cc +++ b/chrome/browser/ui/views/collected_cookies_win.cc @@ -22,8 +22,8 @@ #include "views/layout/box_layout.h" #include "views/layout/grid_layout.h" #include "views/layout/layout_constants.h" +#include "views/widget/native_widget_win.h" #include "views/widget/root_view.h" -#include "views/widget/widget_win.h" #include "views/window/window.h" namespace browser { @@ -374,9 +374,9 @@ void CollectedCookiesWin::AddContentException(views::TreeView* tree_view, infobar_->UpdateVisibility(true, setting, origin_node->GetTitle()); gfx::Rect bounds; GetWidget()->GetBounds(&bounds, false); - // WidgetWin::GetBounds returns the bounds relative to the parent window, - // while WidgetWin::SetBounds wants screen coordinates. Do the translation - // here until http://crbug.com/52851 is fixed. + // NativeWidgetWin::GetBounds returns the bounds relative to the parent + // window, while NativeWidgetWin::SetBounds wants screen coordinates. Do the + // translation here until http://crbug.com/52851 is fixed. POINT topleft = {bounds.x(), bounds.y()}; MapWindowPoints(HWND_DESKTOP, tab_contents_->GetNativeView(), &topleft, 1); gfx::Size size = GetRootView()->GetPreferredSize(); diff --git a/chrome/browser/ui/views/constrained_html_delegate_win.cc b/chrome/browser/ui/views/constrained_html_delegate_win.cc index 98fe7666..177fa93 100644 --- a/chrome/browser/ui/views/constrained_html_delegate_win.cc +++ b/chrome/browser/ui/views/constrained_html_delegate_win.cc @@ -12,7 +12,6 @@ #include "ipc/ipc_message.h" #include "ui/gfx/rect.h" #include "views/view.h" -#include "views/widget/widget_win.h" #include "views/window/window_delegate.h" class ConstrainedHtmlDelegateWin : public TabContentsContainer, diff --git a/chrome/browser/ui/views/constrained_window_win.cc b/chrome/browser/ui/views/constrained_window_win.cc index 116a072..daf4b26 100644 --- a/chrome/browser/ui/views/constrained_window_win.cc +++ b/chrome/browser/ui/views/constrained_window_win.cc @@ -27,7 +27,7 @@ #include "ui/gfx/rect.h" #include "views/controls/button/image_button.h" #include "views/focus/focus_manager.h" -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" #include "views/window/client_view.h" #include "views/window/non_client_view.h" #include "views/window/window_resources.h" @@ -198,8 +198,8 @@ class ConstrainedWindowFrameView SkColor GetTitleColor() const { return (container_->owner()->profile()->IsOffTheRecord() || - !views::WidgetWin::IsAeroGlassEnabled()) ? SK_ColorWHITE - : SK_ColorBLACK; + !views::NativeWidgetWin::IsAeroGlassEnabled()) ? SK_ColorWHITE + : SK_ColorBLACK; } // Loads the appropriate set of WindowResources for the frame view. @@ -536,7 +536,7 @@ gfx::Rect ConstrainedWindowFrameView::CalculateClientAreaBounds( } void ConstrainedWindowFrameView::InitWindowResources() { - resources_.reset(views::WidgetWin::IsAeroGlassEnabled() ? + resources_.reset(views::NativeWidgetWin::IsAeroGlassEnabled() ? static_cast<views::WindowResources*>(new VistaWindowResources) : new XPWindowResources); } @@ -632,7 +632,7 @@ void ConstrainedWindowWin::ActivateConstrainedWindow() { } //////////////////////////////////////////////////////////////////////////////// -// ConstrainedWindowWin, views::WidgetWin overrides: +// ConstrainedWindowWin, views::NativeWidgetWin overrides: void ConstrainedWindowWin::OnDestroy() { // TODO(jcampan): figure out focus restoration diff --git a/chrome/browser/ui/views/download_started_animation_win.cc b/chrome/browser/ui/views/download_started_animation_win.cc index 973eca2..625ca24 100644 --- a/chrome/browser/ui/views/download_started_animation_win.cc +++ b/chrome/browser/ui/views/download_started_animation_win.cc @@ -13,7 +13,7 @@ #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/rect.h" #include "views/controls/image_view.h" -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" // How long to spend moving downwards and fading out after waiting. static const int kMoveTimeMs = 600; @@ -55,7 +55,7 @@ class DownloadStartedAnimationWin : public ui::LinearAnimation, const NotificationDetails& details); // We use a HWND for the popup so that it may float above any HWNDs in our UI. - views::WidgetWin* popup_; + views::NativeWidgetWin* popup_; // The content area holding us. TabContents* tab_contents_; @@ -102,7 +102,7 @@ DownloadStartedAnimationWin::DownloadStartedAnimationWin( SetImage(kDownloadImage); gfx::Rect rc(0, 0, 0, 0); - popup_ = new views::WidgetWin; + popup_ = new views::NativeWidgetWin; popup_->set_window_style(WS_POPUP); popup_->set_window_ex_style(WS_EX_LAYERED | WS_EX_TOOLWINDOW | WS_EX_TRANSPARENT); diff --git a/chrome/browser/ui/views/dropdown_bar_host_win.cc b/chrome/browser/ui/views/dropdown_bar_host_win.cc index ef25f14..30fb85f 100644 --- a/chrome/browser/ui/views/dropdown_bar_host_win.cc +++ b/chrome/browser/ui/views/dropdown_bar_host_win.cc @@ -11,7 +11,7 @@ #include "chrome/browser/ui/views/frame/browser_view.h" #include "ui/base/keycodes/keyboard_code_conversion_win.h" #include "views/controls/scrollbar/native_scroll_bar.h" -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" NativeWebKeyboardEvent DropdownBarHost::GetKeyboardEvent( const TabContents* contents, @@ -23,8 +23,8 @@ NativeWebKeyboardEvent DropdownBarHost::GetKeyboardEvent( } views::Widget* DropdownBarHost::CreateHost() { - views::WidgetWin* widget = new views::WidgetWin(); - // Don't let WidgetWin manage our lifetime. We want our lifetime to + views::NativeWidgetWin* widget = new views::NativeWidgetWin; + // Don't let NativeWidgetWin manage our lifetime. We want our lifetime to // coincide with TabContents. widget->set_delete_on_destroy(false); widget->set_window_style(WS_CHILD | WS_CLIPCHILDREN); diff --git a/chrome/browser/ui/views/find_bar_host_win.cc b/chrome/browser/ui/views/find_bar_host_win.cc index ee0a980..83dbe4a 100644 --- a/chrome/browser/ui/views/find_bar_host_win.cc +++ b/chrome/browser/ui/views/find_bar_host_win.cc @@ -11,7 +11,7 @@ #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "views/controls/scrollbar/native_scroll_bar.h" -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" void FindBarHost::AudibleAlert() { MessageBeep(MB_OK); @@ -20,7 +20,7 @@ void FindBarHost::AudibleAlert() { void FindBarHost::GetWidgetPositionNative(gfx::Rect* avoid_overlapping_rect) { RECT frame_rect = {0}, webcontents_rect = {0}; ::GetWindowRect( - static_cast<views::WidgetWin*>(host())->GetParent(), &frame_rect); + static_cast<views::NativeWidgetWin*>(host())->GetParent(), &frame_rect); ::GetWindowRect( find_bar_controller_-> tab_contents()->tab_contents()->view()->GetNativeView(), diff --git a/chrome/browser/ui/views/first_run_bubble.cc b/chrome/browser/ui/views/first_run_bubble.cc index 802979a..31dd3b8 100644 --- a/chrome/browser/ui/views/first_run_bubble.cc +++ b/chrome/browser/ui/views/first_run_bubble.cc @@ -24,7 +24,7 @@ #include "views/events/event.h" #include "views/focus/focus_manager.h" #include "views/layout/layout_constants.h" -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" #include "views/window/window.h" namespace { @@ -359,7 +359,7 @@ gfx::Size FirstRunOEMBubbleView::GetPreferredSize() { // now, we force Vista to show a correctly-sized box by taking account of // the difference in font size calculation. The coefficient should not be // stored in a variable because it's a hack and should go away. - if (views::WidgetWin::IsAeroGlassEnabled()) { + if (views::NativeWidgetWin::IsAeroGlassEnabled()) { size.set_width(static_cast<int>(size.width() * 0.85)); size.set_height(static_cast<int>(size.height() * 0.85)); } diff --git a/chrome/browser/ui/views/frame/browser_frame_win.cc b/chrome/browser/ui/views/frame/browser_frame_win.cc index e6d8017..dbee422 100644 --- a/chrome/browser/ui/views/frame/browser_frame_win.cc +++ b/chrome/browser/ui/views/frame/browser_frame_win.cc @@ -20,7 +20,7 @@ #include "grit/theme_resources.h" #include "ui/gfx/font.h" #include "views/screen.h" -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" #include "views/window/window_delegate.h" #include "views/window/window_win.h" @@ -111,7 +111,7 @@ bool BrowserFrameWin::AlwaysUseNativeFrame() const { // theme is active for normal browser windows, we don't want to use the custom // frame for popups/apps. if (!browser_view_->IsBrowserTypeNormal() && - views::WidgetWin::IsAeroGlassEnabled()) + views::NativeWidgetWin::IsAeroGlassEnabled()) return true; // Otherwise, we use the native frame when we're told we should by the theme @@ -168,7 +168,7 @@ void BrowserFrameWin::OnEnterSizeMove() { } void BrowserFrameWin::OnExitSizeMove() { - views::WidgetWin::OnExitSizeMove(); + views::NativeWidgetWin::OnExitSizeMove(); } void BrowserFrameWin::OnInitMenuPopup(HMENU menu, UINT position, diff --git a/chrome/browser/ui/views/fullscreen_exit_bubble.cc b/chrome/browser/ui/views/fullscreen_exit_bubble.cc index fc38f30..418893f 100644 --- a/chrome/browser/ui/views/fullscreen_exit_bubble.cc +++ b/chrome/browser/ui/views/fullscreen_exit_bubble.cc @@ -18,7 +18,7 @@ #if defined(OS_WIN) #include "ui/base/l10n/l10n_util_win.h" -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" #elif defined(OS_LINUX) #include "views/widget/widget_gtk.h" #endif @@ -108,12 +108,13 @@ void FullscreenExitBubble::FullscreenExitView::Paint(gfx::Canvas* canvas) { // FullscreenExitPopup --------------------------------------------------------- #if defined(OS_WIN) -class FullscreenExitBubble::FullscreenExitPopup : public views::WidgetWin { +class FullscreenExitBubble::FullscreenExitPopup + : public views::NativeWidgetWin { public: - FullscreenExitPopup() : views::WidgetWin() {} + FullscreenExitPopup() : views::NativeWidgetWin() {} virtual ~FullscreenExitPopup() {} - // views::WidgetWin: + // views::NativeWidgetWin: virtual LRESULT OnMouseActivate(HWND window, UINT hittest_code, UINT message) { diff --git a/chrome/browser/ui/views/generic_info_view_unittest.cc b/chrome/browser/ui/views/generic_info_view_unittest.cc index 8f7cceb..29393f3 100644 --- a/chrome/browser/ui/views/generic_info_view_unittest.cc +++ b/chrome/browser/ui/views/generic_info_view_unittest.cc @@ -14,7 +14,7 @@ #include "views/window/window.h" #if defined(OS_WIN) -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" #endif // This class is only used on windows for now. @@ -25,7 +25,7 @@ using namespace views; class GenericInfoViewTest : public testing::Test { public: Widget* CreateWidget() { - return new WidgetWin(); + return new NativeWidgetWin; } private: MessageLoopForUI message_loop_; @@ -36,7 +36,7 @@ TEST_F(GenericInfoViewTest, GenericInfoView) { const string16 kValue = ASCIIToUTF16("Value"); Widget* window = CreateWidget(); - static_cast<WidgetWin*>(window)->Init(NULL, gfx::Rect(0, 0, 100, 100)); + static_cast<NativeWidgetWin*>(window)->Init(NULL, gfx::Rect(0, 0, 100, 100)); RootView* root_view = window->GetRootView(); GenericInfoView* view1 = new GenericInfoView(1); diff --git a/chrome/browser/ui/views/info_bubble.cc b/chrome/browser/ui/views/info_bubble.cc index aad0b38..a6fdce4 100644 --- a/chrome/browser/ui/views/info_bubble.cc +++ b/chrome/browser/ui/views/info_bubble.cc @@ -208,7 +208,7 @@ void BorderWidget::Init(BorderContents* border_contents, HWND owner) { DCHECK(!border_contents_); border_contents_ = border_contents; border_contents_->Init(); - WidgetWin::Init(owner, gfx::Rect()); + NativeWidgetWin::Init(owner, gfx::Rect()); SetContentsView(border_contents_); SetWindowPos(owner, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOREDRAW); @@ -383,7 +383,7 @@ void InfoBubble::Init(views::Widget* parent, // We make the BorderWidget the owner of the InfoBubble HWND, so that the // latter is displayed on top of the former. - WidgetWin::Init(border_->GetNativeView(), gfx::Rect()); + NativeWidgetWin::Init(border_->GetNativeView(), gfx::Rect()); SetWindowText(GetNativeView(), delegate_->accessible_name().c_str()); #elif defined(OS_LINUX) @@ -522,7 +522,7 @@ void InfoBubble::DoClose(bool closed_by_escape) { show_status_ = kClosed; #if defined(OS_WIN) border_->Close(); - WidgetWin::Close(); + NativeWidgetWin::Close(); #elif defined(OS_LINUX) WidgetGtk::Close(); #endif diff --git a/chrome/browser/ui/views/info_bubble.h b/chrome/browser/ui/views/info_bubble.h index b329e80..79a0eec 100644 --- a/chrome/browser/ui/views/info_bubble.h +++ b/chrome/browser/ui/views/info_bubble.h @@ -13,7 +13,7 @@ #include "views/view.h" #if defined(OS_WIN) -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" #elif defined(OS_LINUX) #include "views/widget/widget_gtk.h" #endif @@ -117,7 +117,7 @@ class BorderContents : public views::View { // we can use >1-bit alpha shadow images on the borders, which look nicer than // the Windows CS_DROPSHADOW shadows. The info bubble window itself cannot be a // layered window because that prevents it from hosting native child controls. -class BorderWidget : public views::WidgetWin { +class BorderWidget : public views::NativeWidgetWin { public: BorderWidget(); virtual ~BorderWidget() { } @@ -142,7 +142,7 @@ class BorderWidget : public views::WidgetWin { BorderContents* border_contents_; private: - // Overridden from WidgetWin: + // Overridden from NativeWidgetWin: virtual LRESULT OnMouseActivate(HWND window, UINT hit_test, UINT mouse_message); @@ -179,7 +179,7 @@ class InfoBubbleDelegate { // That way InfoBubble has no (or very few) ifdefs. class InfoBubble #if defined(OS_WIN) - : public views::WidgetWin, + : public views::NativeWidgetWin, #elif defined(OS_LINUX) : public views::WidgetGtk, #endif @@ -228,7 +228,7 @@ class InfoBubble fade_away_on_close_ = fade_away_on_close; } - // Overridden from WidgetWin: + // Overridden from NativeWidgetWin: virtual void Close(); // Overridden from ui::AnimationDelegate: @@ -256,7 +256,7 @@ class InfoBubble virtual BorderContents* CreateBorderContents(); #if defined(OS_WIN) - // Overridden from WidgetWin: + // Overridden from NativeWidgetWin: virtual void OnActivate(UINT action, BOOL minimized, HWND window); #elif defined(OS_LINUX) // Overridden from WidgetGtk: diff --git a/chrome/browser/ui/views/notifications/balloon_view.cc b/chrome/browser/ui/views/notifications/balloon_view.cc index 69859cb..33cec57 100644 --- a/chrome/browser/ui/views/notifications/balloon_view.cc +++ b/chrome/browser/ui/views/notifications/balloon_view.cc @@ -36,12 +36,7 @@ #include "views/controls/native/native_view_host.h" #include "views/painter.h" #include "views/widget/root_view.h" -#if defined(OS_WIN) -#include "views/widget/widget_win.h" -#endif -#if defined(OS_LINUX) -#include "views/widget/widget_gtk.h" -#endif +#include "views/widget/widget.h" using views::Widget; @@ -99,7 +94,7 @@ BalloonViewImpl::BalloonViewImpl(BalloonCollection* collection) frame_container_(NULL), html_container_(NULL), html_contents_(NULL), - method_factory_(this), + ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)), close_button_(NULL), animation_(NULL), options_menu_model_(NULL), diff --git a/chrome/browser/ui/views/notifications/balloon_view_host.cc b/chrome/browser/ui/views/notifications/balloon_view_host.cc index fcdbadf..869a8b4 100644 --- a/chrome/browser/ui/views/notifications/balloon_view_host.cc +++ b/chrome/browser/ui/views/notifications/balloon_view_host.cc @@ -18,12 +18,6 @@ #endif #endif #include "views/widget/widget.h" -#if defined(OS_WIN) -#include "views/widget/widget_win.h" -#endif -#if defined(OS_LINUX) -#include "views/widget/widget_gtk.h" -#endif class BalloonViewHostView : public views::NativeViewHost { public: diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_view_win.cc b/chrome/browser/ui/views/tab_contents/tab_contents_view_win.cc index 6a5bb7e..870777b 100644 --- a/chrome/browser/ui/views/tab_contents/tab_contents_view_win.cc +++ b/chrome/browser/ui/views/tab_contents/tab_contents_view_win.cc @@ -58,7 +58,7 @@ TabContentsViewWin::~TabContentsViewWin() { void TabContentsViewWin::Unparent() { // Remember who our FocusManager is, we won't be able to access it once // unparented. - focus_manager_ = views::WidgetWin::GetFocusManager(); + focus_manager_ = views::NativeWidgetWin::GetFocusManager(); // Note that we do not DCHECK on focus_manager_ as it may be NULL when used // with an external tab container. ::SetParent(GetNativeView(), NULL); @@ -69,7 +69,7 @@ void TabContentsViewWin::CreateView(const gfx::Size& initial_size) { // Since we create these windows parented to the desktop window initially, we // don't want to create them initially visible. set_window_style(WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS); - WidgetWin::Init(GetDesktopWindow(), gfx::Rect()); + NativeWidgetWin::Init(GetDesktopWindow(), gfx::Rect()); // Remove the root view drop target so we can register our own. RevokeDragDrop(GetNativeView()); @@ -102,7 +102,7 @@ RenderWidgetHostView* TabContentsViewWin::CreateViewForWidget( } gfx::NativeView TabContentsViewWin::GetNativeView() const { - return WidgetWin::GetNativeView(); + return NativeWidgetWin::GetNativeView(); } gfx::NativeView TabContentsViewWin::GetContentNativeView() const { @@ -144,7 +144,7 @@ void TabContentsViewWin::OnDestroy() { drop_target_ = NULL; } - WidgetWin::OnDestroy(); + NativeWidgetWin::OnDestroy(); } void TabContentsViewWin::SetPageTitle(const std::wstring& title) { @@ -307,7 +307,7 @@ void TabContentsViewWin::TakeFocus(bool reverse) { } views::FocusManager* TabContentsViewWin::GetFocusManager() { - views::FocusManager* focus_manager = WidgetWin::GetFocusManager(); + views::FocusManager* focus_manager = NativeWidgetWin::GetFocusManager(); if (focus_manager) { // If focus_manager_ is non NULL, it means we have been reparented, in which // case its value may not be valid anymore. @@ -372,7 +372,7 @@ void TabContentsViewWin::OnMouseLeave() { LRESULT TabContentsViewWin::OnMouseRange(UINT msg, WPARAM w_param, LPARAM l_param) { if (tab_contents()->is_crashed() && sad_tab_ != NULL) { - return WidgetWin::OnMouseRange(msg, w_param, l_param); + return NativeWidgetWin::OnMouseRange(msg, w_param, l_param); } switch (msg) { diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_view_win.h b/chrome/browser/ui/views/tab_contents/tab_contents_view_win.h index fad7edc..57950bb 100644 --- a/chrome/browser/ui/views/tab_contents/tab_contents_view_win.h +++ b/chrome/browser/ui/views/tab_contents/tab_contents_view_win.h @@ -10,7 +10,7 @@ #include "base/timer.h" #include "chrome/browser/tab_contents/tab_contents_view.h" #include "ui/gfx/size.h" -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" class RenderViewContextMenuViews; class SadTabView; @@ -26,7 +26,7 @@ class Point; // Windows-specific implementation of the TabContentsView. It is a HWND that // contains all of the contents of the tab and associated child views. class TabContentsViewWin : public TabContentsView, - public views::WidgetWin { + public views::NativeWidgetWin { public: // The corresponding TabContents is passed in the constructor, and manages our // lifetime. This doesn't need to be the case, but is this way currently @@ -75,7 +75,7 @@ class TabContentsViewWin : public TabContentsView, virtual void GotFocus(); virtual void TakeFocus(bool reverse); - // WidgetWin overridde. + // NativeWidgetWin overridde. virtual views::FocusManager* GetFocusManager(); void EndDragging(); @@ -88,7 +88,7 @@ class TabContentsViewWin : public TabContentsView, // Windows events ------------------------------------------------------------ - // Overrides from WidgetWin. + // Overrides from NativeWidgetWin. virtual void OnDestroy(); virtual void OnHScroll(int scroll_type, short position, HWND scrollbar); virtual void OnMouseLeave(); diff --git a/chrome/browser/ui/views/tabs/base_tab_strip.cc b/chrome/browser/ui/views/tabs/base_tab_strip.cc index 1afbc1b..1a9ecff 100644 --- a/chrome/browser/ui/views/tabs/base_tab_strip.cc +++ b/chrome/browser/ui/views/tabs/base_tab_strip.cc @@ -12,7 +12,7 @@ #include "views/window/window.h" #if defined(OS_WIN) -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" #endif namespace { @@ -99,7 +99,7 @@ class BaseTabStrip::RemoveTabDelegate POINT cursor_point = {GET_X_LPARAM(pos), GET_Y_LPARAM(pos)}; MapWindowPoints(NULL, widget->GetNativeView(), &cursor_point, 1); - static_cast<views::WidgetWin*>(widget)->ResetLastMouseMoveFlag(); + static_cast<views::NativeWidgetWin*>(widget)->ResetLastMouseMoveFlag(); // Return to message loop - otherwise we may disrupt some operation that's // in progress. SendMessage(widget->GetNativeView(), WM_MOUSEMOVE, 0, diff --git a/chrome/browser/ui/views/tabs/dragged_tab_controller.cc b/chrome/browser/ui/views/tabs/dragged_tab_controller.cc index 0ee3832..88d0ee3 100644 --- a/chrome/browser/ui/views/tabs/dragged_tab_controller.cc +++ b/chrome/browser/ui/views/tabs/dragged_tab_controller.cc @@ -40,7 +40,7 @@ #include "views/window/window.h" #if defined(OS_WIN) -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" #endif #if defined(OS_LINUX) @@ -211,7 +211,7 @@ class DraggedTabController::DockDisplayer : public ui::AnimationDelegate { hidden_(false), in_enable_area_(info.in_enable_area()) { #if defined(OS_WIN) - views::WidgetWin* popup = new views::WidgetWin; + views::NativeWidgetWin* popup = new views::NativeWidgetWin; popup_ = popup; popup->set_window_style(WS_POPUP); popup->set_window_ex_style(WS_EX_LAYERED | WS_EX_TOOLWINDOW | @@ -274,7 +274,7 @@ class DraggedTabController::DockDisplayer : public ui::AnimationDelegate { if (!hidden_) return; #if defined(OS_WIN) - static_cast<views::WidgetWin*>(popup_)->Close(); + static_cast<views::NativeWidgetWin*>(popup_)->Close(); #else NOTIMPLEMENTED(); #endif @@ -284,7 +284,7 @@ class DraggedTabController::DockDisplayer : public ui::AnimationDelegate { virtual void UpdateLayeredAlpha() { #if defined(OS_WIN) double scale = in_enable_area_ ? 1 : .5; - static_cast<views::WidgetWin*>(popup_)->SetOpacity( + static_cast<views::NativeWidgetWin*>(popup_)->SetOpacity( static_cast<BYTE>(animation_.GetCurrentValue() * scale * 255.0)); popup_->GetRootView()->SchedulePaint(); #else diff --git a/chrome/browser/ui/views/tabs/dragged_tab_view.cc b/chrome/browser/ui/views/tabs/dragged_tab_view.cc index 367019e..a5e3706 100644 --- a/chrome/browser/ui/views/tabs/dragged_tab_view.cc +++ b/chrome/browser/ui/views/tabs/dragged_tab_view.cc @@ -10,7 +10,7 @@ #include "views/widget/widget.h" #if defined(OS_WIN) -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" #elif defined(OS_LINUX) #include "views/widget/widget_gtk.h" #endif @@ -38,7 +38,7 @@ DraggedTabView::DraggedTabView(views::View* renderer, set_parent_owned(false); #if defined(OS_WIN) - container_.reset(new views::WidgetWin); + container_.reset(new views::NativeWidgetWin); container_->set_delete_on_destroy(false); container_->set_window_style(WS_POPUP); container_->set_window_ex_style( diff --git a/chrome/browser/ui/views/tabs/dragged_tab_view.h b/chrome/browser/ui/views/tabs/dragged_tab_view.h index d2dda61..f772efe 100644 --- a/chrome/browser/ui/views/tabs/dragged_tab_view.h +++ b/chrome/browser/ui/views/tabs/dragged_tab_view.h @@ -13,7 +13,7 @@ namespace views { #if defined(OS_WIN) -class WidgetWin; +class NativeWidgetWin; #elif defined(OS_LINUX) class WidgetGtk; #endif @@ -70,7 +70,7 @@ class DraggedTabView : public views::View { // The window that contains the DraggedTabView. #if defined(OS_WIN) - scoped_ptr<views::WidgetWin> container_; + scoped_ptr<views::NativeWidgetWin> container_; #elif defined(OS_LINUX) scoped_ptr<views::WidgetGtk> container_; #endif diff --git a/chrome/browser/ui/views/tabs/native_view_photobooth_win.cc b/chrome/browser/ui/views/tabs/native_view_photobooth_win.cc index 0a912fb..96f5dc0 100644 --- a/chrome/browser/ui/views/tabs/native_view_photobooth_win.cc +++ b/chrome/browser/ui/views/tabs/native_view_photobooth_win.cc @@ -8,7 +8,7 @@ #include "third_party/skia/include/core/SkBitmap.h" #include "ui/gfx/canvas_skia.h" #include "ui/gfx/point.h" -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" namespace { @@ -149,7 +149,7 @@ void NativeViewPhotoboothWin::CreateCaptureWindow(HWND initial_hwnd) { gfx::Point window_position = GetCaptureWindowPosition(); gfx::Rect capture_bounds(window_position.x(), window_position.y(), contents_rect.Width(), contents_rect.Height()); - capture_window_ = new views::WidgetWin; + capture_window_ = new views::NativeWidgetWin; capture_window_->set_window_style(WS_POPUP); // WS_EX_TOOLWINDOW ensures the capture window doesn't produce a Taskbar // button. diff --git a/chrome/browser/ui/views/tabs/native_view_photobooth_win.h b/chrome/browser/ui/views/tabs/native_view_photobooth_win.h index 44402ae..16e03fd 100644 --- a/chrome/browser/ui/views/tabs/native_view_photobooth_win.h +++ b/chrome/browser/ui/views/tabs/native_view_photobooth_win.h @@ -9,7 +9,7 @@ #include "chrome/browser/ui/views/tabs/native_view_photobooth.h" namespace views { -class WidgetWin; +class NativeWidgetWin; } /////////////////////////////////////////////////////////////////////////////// @@ -47,7 +47,7 @@ class NativeViewPhotoboothWin : public NativeViewPhotobooth { void CreateCaptureWindow(HWND initial_hwnd); // The nearly off-screen photo-booth layered window used to hold the HWND. - views::WidgetWin* capture_window_; + views::NativeWidgetWin* capture_window_; // The current HWND being captured. HWND current_hwnd_; diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc index 84d7517..e81f2f6 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.cc +++ b/chrome/browser/ui/views/tabs/tab_strip.cc @@ -30,7 +30,7 @@ #if defined(OS_WIN) #include "views/widget/monitor_win.h" -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" #elif defined(OS_LINUX) #include "views/widget/widget_gtk.h" #endif @@ -782,7 +782,7 @@ TabStrip::DropInfo::DropInfo(int drop_index, bool drop_before, bool point_down) arrow_view->SetImage(GetDropArrowImage(point_down)); #if defined(OS_WIN) - arrow_window = new views::WidgetWin; + arrow_window = new views::NativeWidgetWin; arrow_window->set_window_style(WS_POPUP); arrow_window->set_window_ex_style(WS_EX_TOPMOST | WS_EX_NOACTIVATE | WS_EX_LAYERED | WS_EX_TRANSPARENT); diff --git a/chrome/browser/ui/views/tabs/tab_strip.h b/chrome/browser/ui/views/tabs/tab_strip.h index 82f3f35..67e3d00 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.h +++ b/chrome/browser/ui/views/tabs/tab_strip.h @@ -22,7 +22,7 @@ class ImageView; #if defined(OS_LINUX) class WidgetGtk; #elif defined(OS_WIN) -class WidgetWin; +class NativeWidgetWin; #endif } @@ -126,7 +126,7 @@ class TabStrip : public BaseTabStrip, // Renders the drop indicator. // TODO(beng): should be views::Widget. #if defined(OS_WIN) - views::WidgetWin* arrow_window; + views::NativeWidgetWin* arrow_window; #else views::WidgetGtk* arrow_window; #endif diff --git a/views/accessibility/view_accessibility.cc b/views/accessibility/view_accessibility.cc index c7ab6cc..fd93aba 100644 --- a/views/accessibility/view_accessibility.cc +++ b/views/accessibility/view_accessibility.cc @@ -6,8 +6,8 @@ #include "ui/base/view_prop.h" #include "views/controls/button/native_button.h" +#include "views/widget/native_widget_win.h" #include "views/widget/widget.h" -#include "views/widget/widget_win.h" const char kViewsNativeHostPropForAccessibility[] = "Views_NativeViewHostHWNDForAccessibility"; @@ -35,8 +35,8 @@ IAccessible* ViewAccessibility::GetAccessibleForView(views::View* view) { // Next, see if the view is a widget container. if (view->child_widget()) { - views::WidgetWin* native_widget = - reinterpret_cast<views::WidgetWin*>(view->child_widget()); + views::NativeWidgetWin* native_widget = + reinterpret_cast<views::NativeWidgetWin*>(view->child_widget()); if (GetNativeIAccessibleInterface( native_widget->GetNativeView(), &accessible) == S_OK) { return accessible; @@ -249,9 +249,10 @@ STDMETHODIMP ViewAccessibility::get_accChild(VARIANT var_child, child_view = view_->GetViewByID(child_id); } } else { - // Negative values are used for events fired using the view's WidgetWin - views::WidgetWin* widget = - static_cast<views::WidgetWin*>(view_->GetWidget()); + // Negative values are used for events fired using the view's + // NativeWidgetWin. + views::NativeWidgetWin* widget = + static_cast<views::NativeWidgetWin*>(view_->GetWidget()); child_view = widget->GetAccessibilityViewEventAt(child_id); } diff --git a/views/controls/menu/menu_host_win.cc b/views/controls/menu/menu_host_win.cc index c22dcb9..2be9ad5 100644 --- a/views/controls/menu/menu_host_win.cc +++ b/views/controls/menu/menu_host_win.cc @@ -42,7 +42,7 @@ void MenuHostWin::Init(HWND parent, const gfx::Rect& bounds, View* contents_view, bool do_capture) { - WidgetWin::Init(parent, bounds); + NativeWidgetWin::Init(parent, bounds); SetContentsView(contents_view); ShowMenuHost(do_capture); } @@ -63,7 +63,7 @@ void MenuHostWin::HideMenuHost() { // Make sure we release capture before hiding. ReleaseMenuHostCapture(); - WidgetWin::Hide(); + NativeWidgetWin::Hide(); } void MenuHostWin::DestroyMenuHost() { @@ -94,11 +94,11 @@ void MenuHostWin::OnDestroy() { // the SubmenuView to drop references to us. submenu_->MenuHostDestroyed(); } - WidgetWin::OnDestroy(); + NativeWidgetWin::OnDestroy(); } void MenuHostWin::OnCaptureChanged(HWND hwnd) { - WidgetWin::OnCaptureChanged(hwnd); + NativeWidgetWin::OnCaptureChanged(hwnd); owns_capture_ = false; } diff --git a/views/controls/menu/menu_host_win.h b/views/controls/menu/menu_host_win.h index ca8e12c..73f4a1c 100644 --- a/views/controls/menu/menu_host_win.h +++ b/views/controls/menu/menu_host_win.h @@ -8,14 +8,14 @@ #pragma once #include "views/controls/menu/menu_host.h" -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" namespace views { class SubmenuView; // MenuHost implementation for windows. -class MenuHostWin : public WidgetWin, public MenuHost { +class MenuHostWin : public NativeWidgetWin, public MenuHost { public: explicit MenuHostWin(SubmenuView* submenu); virtual ~MenuHostWin(); @@ -33,7 +33,7 @@ class MenuHostWin : public WidgetWin, public MenuHost { virtual void ReleaseMenuHostCapture(); virtual gfx::NativeWindow GetMenuHostWindow(); - // WidgetWin overrides: + // NativeWidgetWin overrides: virtual void OnDestroy(); virtual void OnCaptureChanged(HWND hwnd); virtual void OnCancelMode(); diff --git a/views/controls/tabbed_pane/native_tabbed_pane_win.cc b/views/controls/tabbed_pane/native_tabbed_pane_win.cc index aa651ac..bc8b33f 100644 --- a/views/controls/tabbed_pane/native_tabbed_pane_win.cc +++ b/views/controls/tabbed_pane/native_tabbed_pane_win.cc @@ -15,8 +15,8 @@ #include "ui/gfx/native_theme_win.h" #include "views/controls/tabbed_pane/tabbed_pane.h" #include "views/layout/fill_layout.h" +#include "views/widget/native_widget_win.h" #include "views/widget/root_view.h" -#include "views/widget/widget_win.h" namespace views { @@ -288,7 +288,7 @@ void NativeTabbedPaneWin::CreateNativeControl() { SendMessage(tab_control, WM_SETFONT, reinterpret_cast<WPARAM>(font), FALSE); // Create the view container which is a child of the TabControl. - content_window_ = new WidgetWin(); + content_window_ = new NativeWidgetWin; content_window_->Init(tab_control, gfx::Rect()); // Explicitly setting the WS_EX_LAYOUTRTL property for the HWND (see above diff --git a/views/controls/tabbed_pane/native_tabbed_pane_win.h b/views/controls/tabbed_pane/native_tabbed_pane_win.h index 8eac285..37e0f79 100644 --- a/views/controls/tabbed_pane/native_tabbed_pane_win.h +++ b/views/controls/tabbed_pane/native_tabbed_pane_win.h @@ -13,7 +13,7 @@ namespace views { -class WidgetWin; +class NativeWidgetWin; class TabLayout; class NativeTabbedPaneWin : public NativeControlWin, @@ -86,7 +86,7 @@ class NativeTabbedPaneWin : public NativeControlWin, int selected_index_; // The window displayed in the tab. - WidgetWin* content_window_; + NativeWidgetWin* content_window_; DISALLOW_COPY_AND_ASSIGN(NativeTabbedPaneWin); }; diff --git a/views/focus/focus_manager_unittest.cc b/views/focus/focus_manager_unittest.cc index 457ed09..396a11e 100644 --- a/views/focus/focus_manager_unittest.cc +++ b/views/focus/focus_manager_unittest.cc @@ -33,7 +33,7 @@ #include "views/window/window_delegate.h" #if defined(OS_WIN) -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" #include "views/window/window_win.h" #elif defined(OS_LINUX) #include "ui/base/keycodes/keyboard_code_conversion_gtk.h" @@ -293,7 +293,7 @@ class BorderView : public NativeViewHost { if (child == this && is_add) { if (!widget_) { #if defined(OS_WIN) - WidgetWin* widget_win = new WidgetWin(); + NativeWidgetWin* widget_win = new NativeWidgetWin; widget_win->Init(parent->GetRootView()->GetWidget()->GetNativeView(), gfx::Rect(0, 0, 0, 0)); widget_win->SetFocusTraversableParentView(this); @@ -1587,7 +1587,7 @@ TEST_F(FocusManagerTest, CreationForNativeRoot) { ASSERT_TRUE(hwnd); // Create a view window parented to native dialog. - WidgetWin window1; + NativeWidgetWin window1; window1.set_delete_on_destroy(false); window1.set_window_style(WS_CHILD); window1.Init(hwnd, gfx::Rect(0, 0, 100, 100)); @@ -1598,7 +1598,7 @@ TEST_F(FocusManagerTest, CreationForNativeRoot) { EXPECT_TRUE(focus_manager_member1); // Create another view window parented to the first view window. - WidgetWin window2; + NativeWidgetWin window2; window2.set_delete_on_destroy(false); window2.set_window_style(WS_CHILD); window2.Init(window1.GetNativeView(), gfx::Rect(0, 0, 100, 100)); diff --git a/views/focus/focus_manager_win.cc b/views/focus/focus_manager_win.cc index faf3815..dc13cb0 100644 --- a/views/focus/focus_manager_win.cc +++ b/views/focus/focus_manager_win.cc @@ -5,7 +5,7 @@ #include "views/focus/focus_manager.h" #include "views/view.h" -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" namespace views { @@ -23,7 +23,7 @@ void FocusManager::FocusNativeView(gfx::NativeView native_view) { // static FocusManager* FocusManager::GetFocusManagerForNativeView( gfx::NativeView native_view) { - WidgetWin* widget = WidgetWin::GetRootWidget(native_view); + NativeWidgetWin* widget = NativeWidgetWin::GetRootWidget(native_view); return widget ? widget->GetFocusManager() : NULL; } diff --git a/views/view_unittest.cc b/views/view_unittest.cc index d50bac6..1ae67d3 100644 --- a/views/view_unittest.cc +++ b/views/view_unittest.cc @@ -26,9 +26,9 @@ #include "views/window/window.h" #if defined(OS_WIN) -#include "views/widget/widget_win.h" #include "views/controls/button/native_button_win.h" #include "views/test/test_views_delegate.h" +#include "views/widget/native_widget_win.h" #elif defined(OS_LINUX) #include "views/widget/widget_gtk.h" #include "views/window/window_gtk.h" @@ -51,7 +51,7 @@ class ViewTest : public ViewsTestBase { Widget* CreateWidget() { #if defined(OS_WIN) - return new WidgetWin(); + return new NativeWidgetWin; #elif defined(OS_LINUX) return new WidgetGtk(WidgetGtk::TYPE_WINDOW); #endif @@ -351,7 +351,7 @@ TEST_F(ViewTest, MouseEvent) { scoped_ptr<Widget> window(CreateWidget()); #if defined(OS_WIN) - WidgetWin* window_win = static_cast<WidgetWin*>(window.get()); + NativeWidgetWin* window_win = static_cast<NativeWidgetWin*>(window.get()); window_win->set_delete_on_destroy(false); window_win->set_window_style(WS_OVERLAPPEDWINDOW); window_win->Init(NULL, gfx::Rect(50, 50, 650, 650)); @@ -457,7 +457,7 @@ TEST_F(ViewTest, TouchEvent) { #if defined(OS_WIN) // This code would need to be here when we support // touch on windows? - WidgetWin* window_win = static_cast<WidgetWin*>(window.get()); + NativeWidgetWin* window_win = static_cast<NativeWidgetWin*>(window.get()); window_win->set_delete_on_destroy(false); window_win->set_window_style(WS_OVERLAPPEDWINDOW); window_win->Init(NULL, gfx::Rect(50, 50, 650, 650)); @@ -575,7 +575,7 @@ TEST_F(ViewTest, DISABLED_Painting) { RDW_UPDATENOW | RDW_INVALIDATE | RDW_ALLCHILDREN); bool empty_paint = paint_window.empty_paint(); - views::WidgetWin window; + views::NativeWidgetWin window; window.set_delete_on_destroy(false); window.set_window_style(WS_OVERLAPPEDWINDOW); window.Init(NULL, gfx::Rect(50, 50, 650, 650), NULL); @@ -844,7 +844,7 @@ TEST_F(ViewTest, TextfieldCutCopyPaste) { Widget* window = CreateWidget(); #if defined(OS_WIN) - static_cast<WidgetWin*>(window)->Init(NULL, gfx::Rect(0, 0, 100, 100)); + static_cast<NativeWidgetWin*>(window)->Init(NULL, gfx::Rect(0, 0, 100, 100)); #endif RootView* root_view = window->GetRootView(); @@ -966,7 +966,7 @@ TEST_F(ViewTest, ActivateAccelerator) { EXPECT_EQ(view->accelerator_count_map_[return_accelerator], 0); // Create a window and add the view as its child. - WidgetWin window; + NativeWidgetWin window; window.Init(NULL, gfx::Rect(0, 0, 100, 100)); window.set_delete_on_destroy(false); window.set_window_style(WS_OVERLAPPEDWINDOW); @@ -1030,7 +1030,7 @@ TEST_F(ViewTest, HiddenViewWithAccelerator) { view->AddAccelerator(return_accelerator); EXPECT_EQ(view->accelerator_count_map_[return_accelerator], 0); - WidgetWin window; + NativeWidgetWin window; window.Init(NULL, gfx::Rect(0, 0, 100, 100)); window.set_delete_on_destroy(false); window.set_window_style(WS_OVERLAPPEDWINDOW); diff --git a/views/view_win.cc b/views/view_win.cc index f95e9e0..b139caa 100644 --- a/views/view_win.cc +++ b/views/view_win.cc @@ -18,7 +18,7 @@ #include "views/views_delegate.h" #include "views/widget/root_view.h" #include "views/widget/widget.h" -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" namespace views { @@ -46,7 +46,7 @@ void View::NotifyAccessibilityEvent(AccessibilityTypes::Event event_type, // with this view so that clients can call get_accChild in ViewAccessibility // to retrieve the IAccessible associated with this view. if (send_native_event) { - WidgetWin* view_widget = static_cast<WidgetWin*>(GetWidget()); + NativeWidgetWin* view_widget = static_cast<NativeWidgetWin*>(GetWidget()); int child_id = view_widget->AddAccessibilityViewEvent(this); ::NotifyWinEvent(ViewAccessibility::MSAAEvent(event_type), view_widget->GetNativeView(), OBJID_CLIENT, child_id); diff --git a/views/views.gyp b/views/views.gyp index 077c167..881085e 100644 --- a/views/views.gyp +++ b/views/views.gyp @@ -342,13 +342,13 @@ 'widget/tooltip_window_gtk.h', 'widget/monitor_win.cc', 'widget/monitor_win.h', + 'widget/native_widget_win.cc', + 'widget/native_widget_win.h', 'widget/widget.h', 'widget/widget_gtk.cc', 'widget/widget_gtk.h', 'widget/widget_utils.cc', 'widget/widget_utils.h', - 'widget/widget_win.cc', - 'widget/widget_win.h', 'window/client_view.cc', 'window/client_view.h', 'window/custom_frame_view.cc', @@ -401,13 +401,13 @@ 'controls/tree/tree_view.cc', 'events/event_win.cc', 'resize_corner.cc', + 'widget/aero_tooltip_manager.cc', 'widget/child_window_message_processor.cc', 'widget/child_window_message_processor.h', - 'widget/aero_tooltip_manager.cc', + 'widget/native_widget_win.cc', 'widget/root_view_drop_target.cc', 'window/hit_test.cc', 'window/native_frame_view.cc', - 'widget/widget_win.cc', ], }], ['touchui==1', { @@ -473,7 +473,7 @@ 'run_all_unittests.cc', 'test/test_views_delegate.h', 'view_unittest.cc', - 'widget/widget_win_unittest.cc', + 'widget/native_widget_win_unittest.cc', 'window/window_win_unittest.cc', '<(SHARED_INTERMEDIATE_DIR)/app/app_resources/app_resources.rc', diff --git a/views/widget/default_theme_provider.cc b/views/widget/default_theme_provider.cc index 8a03bab..4ba1342 100644 --- a/views/widget/default_theme_provider.cc +++ b/views/widget/default_theme_provider.cc @@ -7,7 +7,7 @@ #include "ui/base/resource/resource_bundle.h" #if defined(OS_WIN) -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" #endif namespace views { @@ -18,7 +18,7 @@ SkBitmap* DefaultThemeProvider::GetBitmapNamed(int id) const { bool DefaultThemeProvider::ShouldUseNativeFrame() const { #if defined(OS_WIN) - return WidgetWin::IsAeroGlassEnabled(); + return NativeWidgetWin::IsAeroGlassEnabled(); #else return false; #endif diff --git a/views/widget/widget_win.cc b/views/widget/native_widget_win.cc index 162d69f..f9efbbb 100644 --- a/views/widget/widget_win.cc +++ b/views/widget/native_widget_win.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 "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" #include <dwmapi.h> @@ -51,11 +51,11 @@ namespace views { // Property used to link the HWND to its RootView. static const char* const kRootViewWindowProperty = "__ROOT_VIEW__"; -// Links the HWND to it's Widget (as a Widget, not a WidgetWin). +// Links the HWND to it's Widget (as a Widget, not a NativeWidgetWin). static const char* const kWidgetKey = "__VIEWS_WIDGET__"; // static -bool WidgetWin::screen_reader_active_ = false; +bool NativeWidgetWin::screen_reader_active_ = false; // A custom MSAA object id used to determine if a screen reader is actively // listening for MSAA events. @@ -67,9 +67,9 @@ RootView* GetRootViewForHWND(HWND hwnd) { } /////////////////////////////////////////////////////////////////////////////// -// WidgetWin, public +// NativeWidgetWin, public -WidgetWin::WidgetWin() +NativeWidgetWin::NativeWidgetWin() : close_widget_factory_(this), active_mouse_tracking_flags_(0), has_capture_(false), @@ -86,35 +86,35 @@ WidgetWin::WidgetWin() accessibility_view_events_(kMaxAccessibilityViewEvents) { } -WidgetWin::~WidgetWin() { +NativeWidgetWin::~NativeWidgetWin() { } // static -WidgetWin* WidgetWin::GetWidget(HWND hwnd) { +NativeWidgetWin* NativeWidgetWin::GetWidget(HWND hwnd) { // TODO(jcivelli): http://crbug.com/44499 We need a way to test that hwnd is - // associated with a WidgetWin (it might be a pure + // associated with a NativeWidgetWin (it might be a pure // WindowImpl). if (!WindowImpl::IsWindowImpl(hwnd)) return NULL; - return reinterpret_cast<WidgetWin*>(ui::GetWindowUserData(hwnd)); + return reinterpret_cast<NativeWidgetWin*>(ui::GetWindowUserData(hwnd)); } // static -WidgetWin* WidgetWin::GetRootWidget(HWND hwnd) { +NativeWidgetWin* NativeWidgetWin::GetRootWidget(HWND hwnd) { // First, check if the top-level window is a Widget. HWND root = ::GetAncestor(hwnd, GA_ROOT); if (!root) return NULL; - WidgetWin* widget = WidgetWin::GetWidget(root); + NativeWidgetWin* widget = NativeWidgetWin::GetWidget(root); if (widget) return widget; // Second, try to locate the last Widget window in the parent hierarchy. HWND parent_hwnd = hwnd; - WidgetWin* parent_widget; + NativeWidgetWin* parent_widget; do { - parent_widget = WidgetWin::GetWidget(parent_hwnd); + parent_widget = NativeWidgetWin::GetWidget(parent_hwnd); if (parent_widget) { widget = parent_widget; parent_hwnd = ::GetAncestor(parent_hwnd, GA_PARENT); @@ -125,7 +125,7 @@ WidgetWin* WidgetWin::GetRootWidget(HWND hwnd) { } // static -bool WidgetWin::IsAeroGlassEnabled() { +bool NativeWidgetWin::IsAeroGlassEnabled() { if (base::win::GetVersion() < base::win::VERSION_VISTA) return false; // If composition is not enabled, we behave like on XP. @@ -133,7 +133,7 @@ bool WidgetWin::IsAeroGlassEnabled() { return SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled; } -void WidgetWin::SetUseLayeredBuffer(bool use_layered_buffer) { +void NativeWidgetWin::SetUseLayeredBuffer(bool use_layered_buffer) { if (use_layered_buffer_ == use_layered_buffer) return; @@ -147,14 +147,14 @@ void WidgetWin::SetUseLayeredBuffer(bool use_layered_buffer) { contents_.reset(NULL); } -View* WidgetWin::GetAccessibilityViewEventAt(int id) { +View* NativeWidgetWin::GetAccessibilityViewEventAt(int id) { // Convert from MSAA child id. id = -(id + 1); DCHECK(id >= 0 && id < kMaxAccessibilityViewEvents); return accessibility_view_events_[id]; } -int WidgetWin::AddAccessibilityViewEvent(View* view) { +int NativeWidgetWin::AddAccessibilityViewEvent(View* view) { accessibility_view_events_index_ = (accessibility_view_events_index_ + 1) % kMaxAccessibilityViewEvents; accessibility_view_events_[accessibility_view_events_index_] = view; @@ -163,7 +163,7 @@ int WidgetWin::AddAccessibilityViewEvent(View* view) { return -(accessibility_view_events_index_ + 1); } -void WidgetWin::ClearAccessibilityViewEvent(View* view) { +void NativeWidgetWin::ClearAccessibilityViewEvent(View* view) { for (std::vector<View*>::iterator it = accessibility_view_events_.begin(); it != accessibility_view_events_.end(); ++it) { @@ -175,7 +175,7 @@ void WidgetWin::ClearAccessibilityViewEvent(View* view) { /////////////////////////////////////////////////////////////////////////////// // Widget implementation: -void WidgetWin::Init(gfx::NativeView parent, const gfx::Rect& bounds) { +void NativeWidgetWin::Init(gfx::NativeView parent, const gfx::Rect& bounds) { // Force creation of the RootView; otherwise, we may get a WM_SIZE after the // window is created and before the root view is set up. GetRootView(); @@ -199,7 +199,7 @@ void WidgetWin::Init(gfx::NativeView parent, const gfx::Rect& bounds) { drop_target_ = new DropTargetWin(root_view_.get()); if ((window_style() & WS_CHILD) == 0 || - (WidgetWin::GetRootWidget(parent) == NULL && + (NativeWidgetWin::GetRootWidget(parent) == NULL && parent != GetDesktopWindow())) { // Top-level widgets and child widgets who do not have a top-level widget // ancestor get a FocusManager. Child widgets parented to the desktop do not @@ -234,23 +234,23 @@ void WidgetWin::Init(gfx::NativeView parent, const gfx::Rect& bounds) { ImmAssociateContextEx(hwnd(), NULL, 0); } -void WidgetWin::InitWithWidget(Widget* parent, const gfx::Rect& bounds) { +void NativeWidgetWin::InitWithWidget(Widget* parent, const gfx::Rect& bounds) { Init(parent->GetNativeView(), bounds); } -WidgetDelegate* WidgetWin::GetWidgetDelegate() { +WidgetDelegate* NativeWidgetWin::GetWidgetDelegate() { return delegate_; } -void WidgetWin::SetWidgetDelegate(WidgetDelegate* delegate) { +void NativeWidgetWin::SetWidgetDelegate(WidgetDelegate* delegate) { delegate_ = delegate; } -void WidgetWin::SetContentsView(View* view) { +void NativeWidgetWin::SetContentsView(View* view) { root_view_->SetContentsView(view); } -void WidgetWin::GetBounds(gfx::Rect* out, bool including_frame) const { +void NativeWidgetWin::GetBounds(gfx::Rect* out, bool including_frame) const { CRect crect; if (including_frame) { GetWindowRect(&crect); @@ -265,7 +265,7 @@ void WidgetWin::GetBounds(gfx::Rect* out, bool including_frame) const { crect.Width(), crect.Height()); } -void WidgetWin::SetBounds(const gfx::Rect& bounds) { +void NativeWidgetWin::SetBounds(const gfx::Rect& bounds) { LONG style = GetWindowLong(GWL_STYLE); if (style & WS_MAXIMIZE) SetWindowLong(GWL_STYLE, style & ~WS_MAXIMIZE); @@ -273,18 +273,18 @@ void WidgetWin::SetBounds(const gfx::Rect& bounds) { SWP_NOACTIVATE | SWP_NOZORDER); } -void WidgetWin::MoveAbove(Widget* other) { +void NativeWidgetWin::MoveAbove(Widget* other) { gfx::Rect bounds; GetBounds(&bounds, false); SetWindowPos(other->GetNativeView(), bounds.x(), bounds.y(), bounds.width(), bounds.height(), SWP_NOACTIVATE); } -void WidgetWin::SetShape(gfx::NativeRegion region) { +void NativeWidgetWin::SetShape(gfx::NativeRegion region) { SetWindowRgn(region, TRUE); } -void WidgetWin::Close() { +void NativeWidgetWin::Close() { if (!IsWindow()) return; // No need to do anything. @@ -298,11 +298,11 @@ void WidgetWin::Close() { // dereference us when the callback returns). MessageLoop::current()->PostTask(FROM_HERE, close_widget_factory_.NewRunnableMethod( - &WidgetWin::CloseNow)); + &NativeWidgetWin::CloseNow)); } } -void WidgetWin::CloseNow() { +void NativeWidgetWin::CloseNow() { // We may already have been destroyed if the selection resulted in a tab // switch which will have reactivated the browser window and closed us, so // we need to check to see if we're still a window before trying to destroy @@ -311,12 +311,12 @@ void WidgetWin::CloseNow() { DestroyWindow(hwnd()); } -void WidgetWin::Show() { +void NativeWidgetWin::Show() { if (IsWindow()) ShowWindow(SW_SHOWNOACTIVATE); } -void WidgetWin::Hide() { +void NativeWidgetWin::Hide() { if (IsWindow()) { // NOTE: Be careful not to activate any windows here (for example, calling // ShowWindow(SW_HIDE) will automatically activate another window). This @@ -328,7 +328,7 @@ void WidgetWin::Hide() { } } -gfx::NativeView WidgetWin::GetNativeView() const { +gfx::NativeView NativeWidgetWin::GetNativeView() const { return WindowImpl::hwnd(); } @@ -348,7 +348,7 @@ static BOOL CALLBACK EnumChildProcForRedraw(HWND hwnd, LPARAM lparam) { return TRUE; } -void WidgetWin::PaintNow(const gfx::Rect& update_rect) { +void NativeWidgetWin::PaintNow(const gfx::Rect& update_rect) { if (use_layered_buffer_) { PaintLayeredWindow(); } else if (root_view_->NeedsPainting(false) && IsWindow()) { @@ -391,18 +391,18 @@ void WidgetWin::PaintNow(const gfx::Rect& update_rect) { } } -void WidgetWin::SetOpacity(unsigned char opacity) { +void NativeWidgetWin::SetOpacity(unsigned char opacity) { layered_alpha_ = static_cast<BYTE>(opacity); } -void WidgetWin::SetAlwaysOnTop(bool on_top) { +void NativeWidgetWin::SetAlwaysOnTop(bool on_top) { if (on_top) set_window_ex_style(window_ex_style() | WS_EX_TOPMOST); else set_window_ex_style(window_ex_style() & ~WS_EX_TOPMOST); } -RootView* WidgetWin::GetRootView() { +RootView* NativeWidgetWin::GetRootView() { if (!root_view_.get()) { // First time the root view is being asked for, create it now. root_view_.reset(CreateRootView()); @@ -410,27 +410,27 @@ RootView* WidgetWin::GetRootView() { return root_view_.get(); } -Widget* WidgetWin::GetRootWidget() const { +Widget* NativeWidgetWin::GetRootWidget() const { return GetRootWidget(hwnd()); } -bool WidgetWin::IsVisible() const { +bool NativeWidgetWin::IsVisible() const { return !!::IsWindowVisible(hwnd()); } -bool WidgetWin::IsActive() const { +bool NativeWidgetWin::IsActive() const { return IsWindowActive(hwnd()); } -bool WidgetWin::IsAccessibleWidget() const { +bool NativeWidgetWin::IsAccessibleWidget() const { return screen_reader_active_; } -TooltipManager* WidgetWin::GetTooltipManager() { +TooltipManager* NativeWidgetWin::GetTooltipManager() { return tooltip_manager_.get(); } -void WidgetWin::GenerateMousePressedForView(View* view, +void NativeWidgetWin::GenerateMousePressedForView(View* view, const gfx::Point& point) { gfx::Point point_in_widget(point); View::ConvertPointToWidget(view, &point_in_widget); @@ -438,19 +438,19 @@ void WidgetWin::GenerateMousePressedForView(View* view, ProcessMousePressed(point_in_widget.ToPOINT(), MK_LBUTTON, false, false); } -bool WidgetWin::GetAccelerator(int cmd_id, ui::Accelerator* accelerator) { +bool NativeWidgetWin::GetAccelerator(int cmd_id, ui::Accelerator* accelerator) { return false; } -Window* WidgetWin::GetWindow() { +Window* NativeWidgetWin::GetWindow() { return GetWindowImpl(hwnd()); } -const Window* WidgetWin::GetWindow() const { +const Window* NativeWidgetWin::GetWindow() const { return GetWindowImpl(hwnd()); } -void WidgetWin::SetNativeWindowProperty(const char* name, void* value) { +void NativeWidgetWin::SetNativeWindowProperty(const char* name, void* value) { // Remove the existing property (if any). for (ViewProps::iterator i = props_.begin(); i != props_.end(); ++i) { if ((*i)->Key() == name) { @@ -463,33 +463,33 @@ void WidgetWin::SetNativeWindowProperty(const char* name, void* value) { props_.push_back(new ViewProp(hwnd(), name, value)); } -void* WidgetWin::GetNativeWindowProperty(const char* name) { +void* NativeWidgetWin::GetNativeWindowProperty(const char* name) { return ViewProp::GetValue(hwnd(), name); } -ThemeProvider* WidgetWin::GetThemeProvider() const { +ThemeProvider* NativeWidgetWin::GetThemeProvider() const { return GetWidgetThemeProvider(this); } -ThemeProvider* WidgetWin::GetDefaultThemeProvider() const { +ThemeProvider* NativeWidgetWin::GetDefaultThemeProvider() const { return default_theme_provider_.get(); } -FocusManager* WidgetWin::GetFocusManager() { +FocusManager* NativeWidgetWin::GetFocusManager() { if (focus_manager_.get()) return focus_manager_.get(); - WidgetWin* widget = static_cast<WidgetWin*>(GetRootWidget()); + NativeWidgetWin* widget = static_cast<NativeWidgetWin*>(GetRootWidget()); if (widget && widget != this) { - // WidgetWin subclasses may override GetFocusManager(), for example for - // dealing with cases where the widget has been unparented. + // NativeWidgetWin subclasses may override GetFocusManager(), for example + // for dealing with cases where the widget has been unparented. return widget->GetFocusManager(); } return NULL; } -void WidgetWin::ViewHierarchyChanged(bool is_add, View *parent, - View *child) { +void NativeWidgetWin::ViewHierarchyChanged(bool is_add, View *parent, + View *child) { if (drop_target_.get()) drop_target_->ResetTargetViewIfEquals(child); @@ -498,7 +498,7 @@ void WidgetWin::ViewHierarchyChanged(bool is_add, View *parent, } -bool WidgetWin::ContainsNativeView(gfx::NativeView native_view) { +bool NativeWidgetWin::ContainsNativeView(gfx::NativeView native_view) { if (hwnd() == native_view) return true; @@ -522,10 +522,10 @@ bool WidgetWin::ContainsNativeView(gfx::NativeView native_view) { //////////////////////////////////////////////////////////////////////////////// // MessageLoop::Observer -void WidgetWin::WillProcessMessage(const MSG& msg) { +void NativeWidgetWin::WillProcessMessage(const MSG& msg) { } -void WidgetWin::DidProcessMessage(const MSG& msg) { +void NativeWidgetWin::DidProcessMessage(const MSG& msg) { if (root_view_->NeedsPainting(true)) PaintNow(root_view_->GetScheduledPaintRect()); } @@ -533,53 +533,55 @@ void WidgetWin::DidProcessMessage(const MSG& msg) { //////////////////////////////////////////////////////////////////////////////// // FocusTraversable -FocusSearch* WidgetWin::GetFocusSearch() { +FocusSearch* NativeWidgetWin::GetFocusSearch() { return root_view_->GetFocusSearch(); } -FocusTraversable* WidgetWin::GetFocusTraversableParent() { +FocusTraversable* NativeWidgetWin::GetFocusTraversableParent() { // We are a proxy to the root view, so we should be bypassed when traversing // up and as a result this should not be called. NOTREACHED(); return NULL; } -void WidgetWin::SetFocusTraversableParent(FocusTraversable* parent) { +void NativeWidgetWin::SetFocusTraversableParent(FocusTraversable* parent) { root_view_->SetFocusTraversableParent(parent); } -View* WidgetWin::GetFocusTraversableParentView() { +View* NativeWidgetWin::GetFocusTraversableParentView() { // We are a proxy to the root view, so we should be bypassed when traversing // up and as a result this should not be called. NOTREACHED(); return NULL; } -void WidgetWin::SetFocusTraversableParentView(View* parent_view) { +void NativeWidgetWin::SetFocusTraversableParentView(View* parent_view) { root_view_->SetFocusTraversableParentView(parent_view); } /////////////////////////////////////////////////////////////////////////////// // Message handlers -void WidgetWin::OnActivate(UINT action, BOOL minimized, HWND window) { +void NativeWidgetWin::OnActivate(UINT action, BOOL minimized, HWND window) { SetMsgHandled(FALSE); } -void WidgetWin::OnActivateApp(BOOL active, DWORD thread_id) { +void NativeWidgetWin::OnActivateApp(BOOL active, DWORD thread_id) { SetMsgHandled(FALSE); } -LRESULT WidgetWin::OnAppCommand(HWND window, short app_command, WORD device, - int keystate) { +LRESULT NativeWidgetWin::OnAppCommand(HWND window, + short app_command, + WORD device, + int keystate) { SetMsgHandled(FALSE); return 0; } -void WidgetWin::OnCancelMode() { +void NativeWidgetWin::OnCancelMode() { } -void WidgetWin::OnCaptureChanged(HWND hwnd) { +void NativeWidgetWin::OnCaptureChanged(HWND hwnd) { if (has_capture_) { if (is_mouse_down_) root_view_->ProcessMouseDragCanceled(); @@ -588,22 +590,23 @@ void WidgetWin::OnCaptureChanged(HWND hwnd) { } } -void WidgetWin::OnClose() { +void NativeWidgetWin::OnClose() { Close(); } -void WidgetWin::OnCommand(UINT notification_code, int command_id, HWND window) { +void NativeWidgetWin::OnCommand(UINT notification_code, int command_id, + HWND window) { SetMsgHandled(FALSE); } -LRESULT WidgetWin::OnCreate(CREATESTRUCT* create_struct) { +LRESULT NativeWidgetWin::OnCreate(CREATESTRUCT* create_struct) { // Widget::GetWidgetFromNativeView expects the contents of this property // to be of type Widget, so the cast is necessary. SetNativeWindowProperty(kWidgetKey, static_cast<Widget*>(this)); return 0; } -void WidgetWin::OnDestroy() { +void NativeWidgetWin::OnDestroy() { if (drop_target_.get()) { RevokeDragDrop(hwnd()); drop_target_ = NULL; @@ -612,40 +615,41 @@ void WidgetWin::OnDestroy() { props_.reset(); } -void WidgetWin::OnDisplayChange(UINT bits_per_pixel, CSize screen_size) { +void NativeWidgetWin::OnDisplayChange(UINT bits_per_pixel, CSize screen_size) { if (GetWidgetDelegate()) GetWidgetDelegate()->DisplayChanged(); } -LRESULT WidgetWin::OnDwmCompositionChanged(UINT msg, - WPARAM w_param, - LPARAM l_param) { +LRESULT NativeWidgetWin::OnDwmCompositionChanged(UINT msg, + WPARAM w_param, + LPARAM l_param) { SetMsgHandled(FALSE); return 0; } -void WidgetWin::OnEndSession(BOOL ending, UINT logoff) { +void NativeWidgetWin::OnEndSession(BOOL ending, UINT logoff) { SetMsgHandled(FALSE); } -void WidgetWin::OnEnterSizeMove() { +void NativeWidgetWin::OnEnterSizeMove() { SetMsgHandled(FALSE); } -LRESULT WidgetWin::OnEraseBkgnd(HDC dc) { +LRESULT NativeWidgetWin::OnEraseBkgnd(HDC dc) { // This is needed for magical win32 flicker ju-ju return 1; } -void WidgetWin::OnExitMenuLoop(BOOL is_track_popup_menu) { +void NativeWidgetWin::OnExitMenuLoop(BOOL is_track_popup_menu) { SetMsgHandled(FALSE); } -void WidgetWin::OnExitSizeMove() { +void NativeWidgetWin::OnExitSizeMove() { SetMsgHandled(FALSE); } -LRESULT WidgetWin::OnGetObject(UINT uMsg, WPARAM w_param, LPARAM l_param) { +LRESULT NativeWidgetWin::OnGetObject(UINT uMsg, WPARAM w_param, + LPARAM l_param) { LRESULT reference_result = static_cast<LRESULT>(0L); // Accessibility readers will send an OBJID_CLIENT message @@ -671,25 +675,27 @@ LRESULT WidgetWin::OnGetObject(UINT uMsg, WPARAM w_param, LPARAM l_param) { return reference_result; } -void WidgetWin::OnGetMinMaxInfo(MINMAXINFO* minmax_info) { +void NativeWidgetWin::OnGetMinMaxInfo(MINMAXINFO* minmax_info) { SetMsgHandled(FALSE); } -void WidgetWin::OnHScroll(int scroll_type, short position, HWND scrollbar) { +void NativeWidgetWin::OnHScroll(int scroll_type, short position, + HWND scrollbar) { SetMsgHandled(FALSE); } -void WidgetWin::OnInitMenu(HMENU menu) { +void NativeWidgetWin::OnInitMenu(HMENU menu) { SetMsgHandled(FALSE); } -void WidgetWin::OnInitMenuPopup(HMENU menu, +void NativeWidgetWin::OnInitMenuPopup(HMENU menu, UINT position, BOOL is_system_menu) { SetMsgHandled(FALSE); } -LRESULT WidgetWin::OnKeyDown(UINT message, WPARAM w_param, LPARAM l_param) { +LRESULT NativeWidgetWin::OnKeyDown(UINT message, WPARAM w_param, + LPARAM l_param) { RootView* root_view = GetFocusedViewRootView(); if (!root_view) root_view = root_view_.get(); @@ -700,7 +706,7 @@ LRESULT WidgetWin::OnKeyDown(UINT message, WPARAM w_param, LPARAM l_param) { return 0; } -LRESULT WidgetWin::OnKeyUp(UINT message, WPARAM w_param, LPARAM l_param) { +LRESULT NativeWidgetWin::OnKeyUp(UINT message, WPARAM w_param, LPARAM l_param) { RootView* root_view = GetFocusedViewRootView(); if (!root_view) root_view = root_view_.get(); @@ -711,7 +717,7 @@ LRESULT WidgetWin::OnKeyUp(UINT message, WPARAM w_param, LPARAM l_param) { return 0; } -void WidgetWin::OnKillFocus(HWND focused_window) { +void NativeWidgetWin::OnKillFocus(HWND focused_window) { GetFocusManager()->GetWidgetFocusManager()->OnWidgetFocusEvent( this->GetNativeView(), focused_window); @@ -724,47 +730,49 @@ void WidgetWin::OnKillFocus(HWND focused_window) { // a separate member on the MouseEvent, then audit all consumers of MouseEvents // to fix them to use the resulting values correctly. -void WidgetWin::OnLButtonDown(UINT flags, const CPoint& point) { +void NativeWidgetWin::OnLButtonDown(UINT flags, const CPoint& point) { ProcessMousePressed(point, flags | MK_LBUTTON, false, false); } -void WidgetWin::OnLButtonUp(UINT flags, const CPoint& point) { +void NativeWidgetWin::OnLButtonUp(UINT flags, const CPoint& point) { ProcessMouseReleased(point, flags | MK_LBUTTON); } -void WidgetWin::OnLButtonDblClk(UINT flags, const CPoint& point) { +void NativeWidgetWin::OnLButtonDblClk(UINT flags, const CPoint& point) { ProcessMousePressed(point, flags | MK_LBUTTON, true, false); } -void WidgetWin::OnMButtonDown(UINT flags, const CPoint& point) { +void NativeWidgetWin::OnMButtonDown(UINT flags, const CPoint& point) { ProcessMousePressed(point, flags | MK_MBUTTON, false, false); } -void WidgetWin::OnMButtonUp(UINT flags, const CPoint& point) { +void NativeWidgetWin::OnMButtonUp(UINT flags, const CPoint& point) { ProcessMouseReleased(point, flags | MK_MBUTTON); } -void WidgetWin::OnMButtonDblClk(UINT flags, const CPoint& point) { +void NativeWidgetWin::OnMButtonDblClk(UINT flags, const CPoint& point) { ProcessMousePressed(point, flags | MK_MBUTTON, true, false); } -LRESULT WidgetWin::OnMouseActivate(HWND window, UINT hittest_code, +LRESULT NativeWidgetWin::OnMouseActivate(HWND window, UINT hittest_code, UINT message) { SetMsgHandled(FALSE); return MA_ACTIVATE; } -void WidgetWin::OnMouseMove(UINT flags, const CPoint& point) { +void NativeWidgetWin::OnMouseMove(UINT flags, const CPoint& point) { ProcessMouseMoved(point, flags, false); } -LRESULT WidgetWin::OnMouseLeave(UINT message, WPARAM w_param, LPARAM l_param) { +LRESULT NativeWidgetWin::OnMouseLeave(UINT message, WPARAM w_param, + LPARAM l_param) { tooltip_manager_->OnMouseLeave(); ProcessMouseExited(); return 0; } -LRESULT WidgetWin::OnMouseWheel(UINT message, WPARAM w_param, LPARAM l_param) { +LRESULT NativeWidgetWin::OnMouseWheel(UINT message, WPARAM w_param, + LPARAM l_param) { // Reroute the mouse-wheel to the window under the mouse pointer if // applicable. if (message == WM_MOUSEWHEEL && @@ -780,64 +788,65 @@ LRESULT WidgetWin::OnMouseWheel(UINT message, WPARAM w_param, LPARAM l_param) { return root_view_->ProcessMouseWheelEvent(e) ? 0 : 1; } -void WidgetWin::OnMove(const CPoint& point) { +void NativeWidgetWin::OnMove(const CPoint& point) { SetMsgHandled(FALSE); } -void WidgetWin::OnMoving(UINT param, const LPRECT new_bounds) { +void NativeWidgetWin::OnMoving(UINT param, const LPRECT new_bounds) { } -LRESULT WidgetWin::OnMouseRange(UINT msg, WPARAM w_param, LPARAM l_param) { +LRESULT NativeWidgetWin::OnMouseRange(UINT msg, WPARAM w_param, + LPARAM l_param) { tooltip_manager_->OnMouse(msg, w_param, l_param); SetMsgHandled(FALSE); return 0; } -LRESULT WidgetWin::OnNCActivate(BOOL active) { +LRESULT NativeWidgetWin::OnNCActivate(BOOL active) { SetMsgHandled(FALSE); return 0; } -LRESULT WidgetWin::OnNCCalcSize(BOOL w_param, LPARAM l_param) { +LRESULT NativeWidgetWin::OnNCCalcSize(BOOL w_param, LPARAM l_param) { SetMsgHandled(FALSE); return 0; } -LRESULT WidgetWin::OnNCHitTest(const CPoint& pt) { +LRESULT NativeWidgetWin::OnNCHitTest(const CPoint& pt) { SetMsgHandled(FALSE); return 0; } -void WidgetWin::OnNCLButtonDblClk(UINT flags, const CPoint& point) { +void NativeWidgetWin::OnNCLButtonDblClk(UINT flags, const CPoint& point) { SetMsgHandled(ProcessMousePressed(point, flags | MK_LBUTTON, true, true)); } -void WidgetWin::OnNCLButtonDown(UINT flags, const CPoint& point) { +void NativeWidgetWin::OnNCLButtonDown(UINT flags, const CPoint& point) { SetMsgHandled(ProcessMousePressed(point, flags | MK_LBUTTON, false, true)); } -void WidgetWin::OnNCLButtonUp(UINT flags, const CPoint& point) { +void NativeWidgetWin::OnNCLButtonUp(UINT flags, const CPoint& point) { SetMsgHandled(FALSE); } -void WidgetWin::OnNCMButtonDblClk(UINT flags, const CPoint& point) { +void NativeWidgetWin::OnNCMButtonDblClk(UINT flags, const CPoint& point) { SetMsgHandled(ProcessMousePressed(point, flags | MK_MBUTTON, true, true)); } -void WidgetWin::OnNCMButtonDown(UINT flags, const CPoint& point) { +void NativeWidgetWin::OnNCMButtonDown(UINT flags, const CPoint& point) { SetMsgHandled(ProcessMousePressed(point, flags | MK_MBUTTON, false, true)); } -void WidgetWin::OnNCMButtonUp(UINT flags, const CPoint& point) { +void NativeWidgetWin::OnNCMButtonUp(UINT flags, const CPoint& point) { SetMsgHandled(FALSE); } -LRESULT WidgetWin::OnNCMouseLeave(UINT uMsg, WPARAM w_param, LPARAM l_param) { +LRESULT NativeWidgetWin::OnNCMouseLeave(UINT uMsg, WPARAM w_param, LPARAM l_param) { ProcessMouseExited(); return 0; } -LRESULT WidgetWin::OnNCMouseMove(UINT flags, const CPoint& point) { +LRESULT NativeWidgetWin::OnNCMouseMove(UINT flags, const CPoint& point) { // NC points are in screen coordinates. CPoint temp = point; MapWindowPoints(HWND_DESKTOP, hwnd(), &temp, 1); @@ -849,35 +858,35 @@ LRESULT WidgetWin::OnNCMouseMove(UINT flags, const CPoint& point) { return 0; } -void WidgetWin::OnNCPaint(HRGN rgn) { +void NativeWidgetWin::OnNCPaint(HRGN rgn) { SetMsgHandled(FALSE); } -void WidgetWin::OnNCRButtonDblClk(UINT flags, const CPoint& point) { +void NativeWidgetWin::OnNCRButtonDblClk(UINT flags, const CPoint& point) { SetMsgHandled(ProcessMousePressed(point, flags | MK_RBUTTON, true, true)); } -void WidgetWin::OnNCRButtonDown(UINT flags, const CPoint& point) { +void NativeWidgetWin::OnNCRButtonDown(UINT flags, const CPoint& point) { SetMsgHandled(ProcessMousePressed(point, flags | MK_RBUTTON, false, true)); } -void WidgetWin::OnNCRButtonUp(UINT flags, const CPoint& point) { +void NativeWidgetWin::OnNCRButtonUp(UINT flags, const CPoint& point) { SetMsgHandled(FALSE); } -LRESULT WidgetWin::OnNCUAHDrawCaption(UINT msg, - WPARAM w_param, - LPARAM l_param) { +LRESULT NativeWidgetWin::OnNCUAHDrawCaption(UINT msg, + WPARAM w_param, + LPARAM l_param) { SetMsgHandled(FALSE); return 0; } -LRESULT WidgetWin::OnNCUAHDrawFrame(UINT msg, WPARAM w_param, LPARAM l_param) { +LRESULT NativeWidgetWin::OnNCUAHDrawFrame(UINT msg, WPARAM w_param, LPARAM l_param) { SetMsgHandled(FALSE); return 0; } -LRESULT WidgetWin::OnNotify(int w_param, NMHDR* l_param) { +LRESULT NativeWidgetWin::OnNotify(int w_param, NMHDR* l_param) { // We can be sent this message before the tooltip manager is created, if a // subclass overrides OnCreate and creates some kind of Windows control there // that sends WM_NOTIFY messages. @@ -891,11 +900,11 @@ LRESULT WidgetWin::OnNotify(int w_param, NMHDR* l_param) { return 0; } -void WidgetWin::OnPaint(HDC dc) { +void NativeWidgetWin::OnPaint(HDC dc) { root_view_->OnPaint(hwnd()); } -LRESULT WidgetWin::OnPowerBroadcast(DWORD power_event, DWORD data) { +LRESULT NativeWidgetWin::OnPowerBroadcast(DWORD power_event, DWORD data) { ui::SystemMonitor* monitor = ui::SystemMonitor::Get(); if (monitor) monitor->ProcessWmPowerBroadcastMessage(power_event); @@ -903,78 +912,78 @@ LRESULT WidgetWin::OnPowerBroadcast(DWORD power_event, DWORD data) { return 0; } -void WidgetWin::OnRButtonDown(UINT flags, const CPoint& point) { +void NativeWidgetWin::OnRButtonDown(UINT flags, const CPoint& point) { ProcessMousePressed(point, flags | MK_RBUTTON, false, false); } -void WidgetWin::OnRButtonUp(UINT flags, const CPoint& point) { +void NativeWidgetWin::OnRButtonUp(UINT flags, const CPoint& point) { ProcessMouseReleased(point, flags | MK_RBUTTON); } -void WidgetWin::OnRButtonDblClk(UINT flags, const CPoint& point) { +void NativeWidgetWin::OnRButtonDblClk(UINT flags, const CPoint& point) { ProcessMousePressed(point, flags | MK_RBUTTON, true, false); } -LRESULT WidgetWin::OnReflectedMessage(UINT msg, - WPARAM w_param, - LPARAM l_param) { +LRESULT NativeWidgetWin::OnReflectedMessage(UINT msg, + WPARAM w_param, + LPARAM l_param) { SetMsgHandled(FALSE); return 0; } -void WidgetWin::OnSetFocus(HWND focused_window) { +void NativeWidgetWin::OnSetFocus(HWND focused_window) { GetFocusManager()->GetWidgetFocusManager()->OnWidgetFocusEvent( focused_window, this->GetNativeView()); SetMsgHandled(FALSE); } -LRESULT WidgetWin::OnSetIcon(UINT size_type, HICON new_icon) { +LRESULT NativeWidgetWin::OnSetIcon(UINT size_type, HICON new_icon) { SetMsgHandled(FALSE); return 0; } -LRESULT WidgetWin::OnSetText(const wchar_t* text) { +LRESULT NativeWidgetWin::OnSetText(const wchar_t* text) { SetMsgHandled(FALSE); return 0; } -void WidgetWin::OnSettingChange(UINT flags, const wchar_t* section) { +void NativeWidgetWin::OnSettingChange(UINT flags, const wchar_t* section) { if (flags == SPI_SETWORKAREA && GetWidgetDelegate()) GetWidgetDelegate()->WorkAreaChanged(); SetMsgHandled(FALSE); } -void WidgetWin::OnSize(UINT param, const CSize& size) { +void NativeWidgetWin::OnSize(UINT param, const CSize& size) { LayoutRootView(); } -void WidgetWin::OnSysCommand(UINT notification_code, CPoint click) { +void NativeWidgetWin::OnSysCommand(UINT notification_code, CPoint click) { } -void WidgetWin::OnThemeChanged() { +void NativeWidgetWin::OnThemeChanged() { // Notify NativeTheme. gfx::NativeTheme::instance()->CloseHandles(); } -void WidgetWin::OnFinalMessage(HWND window) { +void NativeWidgetWin::OnFinalMessage(HWND window) { if (delete_on_destroy_) delete this; } -void WidgetWin::OnVScroll(int scroll_type, short position, HWND scrollbar) { +void NativeWidgetWin::OnVScroll(int scroll_type, short position, HWND scrollbar) { SetMsgHandled(FALSE); } -void WidgetWin::OnWindowPosChanging(WINDOWPOS* window_pos) { +void NativeWidgetWin::OnWindowPosChanging(WINDOWPOS* window_pos) { SetMsgHandled(FALSE); } -void WidgetWin::OnWindowPosChanged(WINDOWPOS* window_pos) { +void NativeWidgetWin::OnWindowPosChanged(WINDOWPOS* window_pos) { SetMsgHandled(FALSE); } -gfx::Size WidgetWin::GetRootViewSize() const { +gfx::Size NativeWidgetWin::GetRootViewSize() const { CRect rect; if (use_layered_buffer_) GetWindowRect(&rect); @@ -985,9 +994,9 @@ gfx::Size WidgetWin::GetRootViewSize() const { } /////////////////////////////////////////////////////////////////////////////// -// WidgetWin, protected: +// NativeWidgetWin, protected: -void WidgetWin::TrackMouseEvents(DWORD mouse_tracking_flags) { +void NativeWidgetWin::TrackMouseEvents(DWORD mouse_tracking_flags) { // Begin tracking mouse events for this HWND so that we get WM_MOUSELEAVE // when the user moves the mouse outside this HWND's bounds. if (active_mouse_tracking_flags_ == 0 || mouse_tracking_flags & TME_CANCEL) { @@ -1011,10 +1020,10 @@ void WidgetWin::TrackMouseEvents(DWORD mouse_tracking_flags) { } } -bool WidgetWin::ProcessMousePressed(const CPoint& point, - UINT flags, - bool dbl_click, - bool non_client) { +bool NativeWidgetWin::ProcessMousePressed(const CPoint& point, + UINT flags, + bool dbl_click, + bool non_client) { last_mouse_event_was_move_ = false; // Windows gives screen coordinates for nonclient events, while the RootView // expects window coordinates; convert if necessary. @@ -1038,7 +1047,7 @@ bool WidgetWin::ProcessMousePressed(const CPoint& point, return false; } -void WidgetWin::ProcessMouseDragged(const CPoint& point, UINT flags) { +void NativeWidgetWin::ProcessMouseDragged(const CPoint& point, UINT flags) { last_mouse_event_was_move_ = false; MouseEvent mouse_drag(ui::ET_MOUSE_DRAGGED, point.x, @@ -1047,7 +1056,7 @@ void WidgetWin::ProcessMouseDragged(const CPoint& point, UINT flags) { root_view_->OnMouseDragged(mouse_drag); } -void WidgetWin::ProcessMouseReleased(const CPoint& point, UINT flags) { +void NativeWidgetWin::ProcessMouseReleased(const CPoint& point, UINT flags) { last_mouse_event_was_move_ = false; MouseEvent mouse_up(ui::ET_MOUSE_RELEASED, point.x, @@ -1063,8 +1072,8 @@ void WidgetWin::ProcessMouseReleased(const CPoint& point, UINT flags) { root_view_->OnMouseReleased(mouse_up, false); } -void WidgetWin::ProcessMouseMoved(const CPoint &point, UINT flags, - bool is_nonclient) { +void NativeWidgetWin::ProcessMouseMoved(const CPoint &point, UINT flags, + bool is_nonclient) { // Windows only fires WM_MOUSELEAVE events if the application begins // "tracking" mouse events for a given HWND during WM_MOUSEMOVE events. // We need to call |TrackMouseEvents| to listen for WM_MOUSELEAVE. @@ -1091,15 +1100,15 @@ void WidgetWin::ProcessMouseMoved(const CPoint &point, UINT flags, } } -void WidgetWin::ProcessMouseExited() { +void NativeWidgetWin::ProcessMouseExited() { last_mouse_event_was_move_ = false; root_view_->ProcessOnMouseExited(); - // Reset our tracking flag so that future mouse movement over this WidgetWin + // Reset our tracking flag so that future mouse movement over this NativeWidgetWin // results in a new tracking session. active_mouse_tracking_flags_ = 0; } -void WidgetWin::LayoutRootView() { +void NativeWidgetWin::LayoutRootView() { gfx::Size size(GetRootViewSize()); if (use_layered_buffer_) @@ -1114,29 +1123,29 @@ void WidgetWin::LayoutRootView() { PaintNow(gfx::Rect(0, 0, size.width(), size.height())); } -void WidgetWin::OnScreenReaderDetected() { +void NativeWidgetWin::OnScreenReaderDetected() { screen_reader_active_ = true; } -bool WidgetWin::ReleaseCaptureOnMouseReleased() { +bool NativeWidgetWin::ReleaseCaptureOnMouseReleased() { return true; } -RootView* WidgetWin::CreateRootView() { +RootView* NativeWidgetWin::CreateRootView() { return new RootView(this); } /////////////////////////////////////////////////////////////////////////////// -// WidgetWin, private: +// NativeWidgetWin, private: // static -Window* WidgetWin::GetWindowImpl(HWND hwnd) { +Window* NativeWidgetWin::GetWindowImpl(HWND hwnd) { // NOTE: we can't use GetAncestor here as constrained windows are a Window, // but not a top level window. HWND parent = hwnd; while (parent) { - WidgetWin* widget = - reinterpret_cast<WidgetWin*>(ui::GetWindowUserData(parent)); + NativeWidgetWin* widget = + reinterpret_cast<NativeWidgetWin*>(ui::GetWindowUserData(parent)); if (widget && widget->is_window_) return static_cast<WindowWin*>(widget); parent = ::GetParent(parent); @@ -1144,13 +1153,13 @@ Window* WidgetWin::GetWindowImpl(HWND hwnd) { return NULL; } -void WidgetWin::SizeContents(const gfx::Size& window_size) { +void NativeWidgetWin::SizeContents(const gfx::Size& window_size) { contents_.reset(new gfx::CanvasSkia(window_size.width(), window_size.height(), false)); } -void WidgetWin::PaintLayeredWindow() { +void NativeWidgetWin::PaintLayeredWindow() { // Painting monkeys with our cliprect, so we need to save it so that the // call to UpdateLayeredWindow updates the entire window, not just the // cliprect. @@ -1164,7 +1173,7 @@ void WidgetWin::PaintLayeredWindow() { UpdateWindowFromContents(contents_->getTopPlatformDevice().getBitmapDC()); } -void WidgetWin::UpdateWindowFromContents(HDC dib_dc) { +void NativeWidgetWin::UpdateWindowFromContents(HDC dib_dc) { DCHECK(use_layered_buffer_); if (can_update_layered_window_) { CRect wr; @@ -1180,7 +1189,7 @@ void WidgetWin::UpdateWindowFromContents(HDC dib_dc) { } } -RootView* WidgetWin::GetFocusedViewRootView() { +RootView* NativeWidgetWin::GetFocusedViewRootView() { FocusManager* focus_manager = GetFocusManager(); if (!focus_manager) { NOTREACHED(); @@ -1213,7 +1222,7 @@ static HWND GetControlHWNDForMessage(UINT message, return NULL; } -HICON WidgetWin::GetDefaultWindowIcon() const { +HICON NativeWidgetWin::GetDefaultWindowIcon() const { if (ViewsDelegate::views_delegate) return ViewsDelegate::views_delegate->GetDefaultWindowIcon(); return NULL; @@ -1244,13 +1253,13 @@ static bool ProcessChildWindowMessage(UINT message, return false; } -LRESULT WidgetWin::OnWndProc(UINT message, WPARAM w_param, LPARAM l_param) { +LRESULT NativeWidgetWin::OnWndProc(UINT message, WPARAM w_param, LPARAM l_param) { HWND window = hwnd(); LRESULT result = 0; // First allow messages sent by child controls to be processed directly by // their associated views. If such a view is present, it will handle the - // message *instead of* this WidgetWin. + // message *instead of* this NativeWidgetWin. if (ProcessChildWindowMessage(message, w_param, l_param, &result)) return result; @@ -1271,8 +1280,8 @@ LRESULT WidgetWin::OnWndProc(UINT message, WPARAM w_param, LPARAM l_param) { } // static -void WidgetWin::PostProcessActivateMessage(WidgetWin* widget, - int activation_state) { +void NativeWidgetWin::PostProcessActivateMessage(NativeWidgetWin* widget, + int activation_state) { if (!widget->focus_manager_.get()) { NOTREACHED(); return; @@ -1300,7 +1309,7 @@ void WidgetWin::PostProcessActivateMessage(WidgetWin* widget, } } -void WidgetWin::MakeMSG(MSG* msg, UINT message, WPARAM w_param, +void NativeWidgetWin::MakeMSG(MSG* msg, UINT message, WPARAM w_param, LPARAM l_param) const { msg->hwnd = hwnd(); msg->message = message; @@ -1318,7 +1327,7 @@ Widget* Widget::CreatePopupWidget(TransparencyParam transparent, EventsParam accept_events, DeleteParam delete_on_destroy, MirroringParam mirror_in_rtl) { - WidgetWin* popup = new WidgetWin; + NativeWidgetWin* popup = new NativeWidgetWin; DWORD ex_style = WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE; if (mirror_in_rtl == MirrorOriginInRTL) ex_style |= l10n_util::GetExtendedTooltipStyles(); diff --git a/views/widget/widget_win.h b/views/widget/native_widget_win.h index c93db90..7143491 100644 --- a/views/widget/widget_win.h +++ b/views/widget/native_widget_win.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 VIEWS_WIDGET_WIDGET_WIN_H_ -#define VIEWS_WIDGET_WIDGET_WIN_H_ +#ifndef VIEWS_WIDGET_NATIVE_WIDGET_WIN_H_ +#define VIEWS_WIDGET_NATIVE_WIDGET_WIN_H_ #pragma once #include <atlbase.h> @@ -64,7 +64,7 @@ const int WM_NCUAHDRAWFRAME = 0xAF; /////////////////////////////////////////////////////////////////////////////// // -// WidgetWin +// NativeWidgetWin // A Widget for a views hierarchy used to represent anything that can be // contained within an HWND, e.g. a control, a window, etc. Specializations // suitable for specific tasks, e.g. top level window, are derived from this. @@ -75,19 +75,19 @@ const int WM_NCUAHDRAWFRAME = 0xAF; // then responsible for cleaning up after it. // /////////////////////////////////////////////////////////////////////////////// -class WidgetWin : public ui::WindowImpl, - public Widget, - public MessageLoopForUI::Observer, - public FocusTraversable { +class NativeWidgetWin : public ui::WindowImpl, + public Widget, + public MessageLoopForUI::Observer, + public FocusTraversable { public: - WidgetWin(); - virtual ~WidgetWin(); + NativeWidgetWin(); + virtual ~NativeWidgetWin(); // Returns the Widget associated with the specified HWND (if any). - static WidgetWin* GetWidget(HWND hwnd); + static NativeWidgetWin* GetWidget(HWND hwnd); // Returns the root Widget associated with the specified HWND (if any). - static WidgetWin* GetRootWidget(HWND hwnd); + static NativeWidgetWin* GetRootWidget(HWND hwnd); // Returns true if we are on Windows Vista or greater and composition is // enabled. @@ -114,13 +114,13 @@ class WidgetWin : public ui::WindowImpl, // child id which is generated by: -(index of view in vector + 1) which // guarantees a negative child id. This distinguishes the view from // positive MSAA child id's which are direct leaf children of views that have - // associated hWnd's (e.g. WidgetWin). + // associated hWnd's (e.g. NativeWidgetWin). int AddAccessibilityViewEvent(View* view); // Clear a view that has recently been removed on a hierarchy change. void ClearAccessibilityViewEvent(View* view); - BEGIN_MSG_MAP_EX(WidgetWin) + BEGIN_MSG_MAP_EX(NativeWidgetWin) // Range handlers must go first! MESSAGE_RANGE_HANDLER_EX(WM_MOUSEFIRST, WM_MOUSELAST, OnMouseRange) MESSAGE_RANGE_HANDLER_EX(WM_NCMOUSEMOVE, WM_NCMOUSEMOVE, OnMouseRange) @@ -460,7 +460,7 @@ class WidgetWin : public ui::WindowImpl, // create specialized RootView implementations. virtual RootView* CreateRootView(); - // Returns true if this WidgetWin is opaque. + // Returns true if this NativeWidgetWin is opaque. bool opaque() const { return opaque_; } // The TooltipManager. @@ -518,15 +518,15 @@ class WidgetWin : public ui::WindowImpl, // Called after the WM_ACTIVATE message has been processed by the default // windows procedure. - static void PostProcessActivateMessage(WidgetWin* widget, + static void PostProcessActivateMessage(NativeWidgetWin* widget, int activation_state); // Fills out a MSG struct with the supplied values. void MakeMSG(MSG* msg, UINT message, WPARAM w_param, LPARAM l_param) const; - // The following factory is used for calls to close the WidgetWin + // The following factory is used for calls to close the NativeWidgetWin // instance. - ScopedRunnableMethodFactory<WidgetWin> close_widget_factory_; + ScopedRunnableMethodFactory<NativeWidgetWin> close_widget_factory_; // The flags currently being used with TrackMouseEvent to track mouse // messages. 0 if there is no active tracking. The value of this member is @@ -604,9 +604,9 @@ class WidgetWin : public ui::WindowImpl, ViewProps props_; - DISALLOW_COPY_AND_ASSIGN(WidgetWin); + DISALLOW_COPY_AND_ASSIGN(NativeWidgetWin); }; } // namespace views -#endif // VIEWS_WIDGET_WIDGET_WIN_H_ +#endif // VIEWS_WIDGET_NATIVE_WIDGET_WIN_H_ diff --git a/views/widget/widget_win_unittest.cc b/views/widget/native_widget_win_unittest.cc index d0cb4e4..a646b34 100644 --- a/views/widget/widget_win_unittest.cc +++ b/views/widget/native_widget_win_unittest.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 "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" #include "base/basictypes.h" #include "base/message_loop.h" @@ -11,13 +11,13 @@ using namespace views; -class WidgetWinTest : public testing::Test { +class NativeWidgetWinTest : public testing::Test { public: - WidgetWinTest() { + NativeWidgetWinTest() { OleInitialize(NULL); } - ~WidgetWinTest() { + ~NativeWidgetWinTest() { OleUninitialize(); } @@ -29,7 +29,7 @@ class WidgetWinTest : public testing::Test { // Create a simple widget win. The caller is responsible for taking ownership // of the returned value. - WidgetWin* CreateWidgetWin(); + NativeWidgetWin* CreateNativeWidgetWin(); void RunPendingMessages() { message_loop_.RunAllPending(); @@ -38,20 +38,20 @@ class WidgetWinTest : public testing::Test { private: MessageLoopForUI message_loop_; - DISALLOW_COPY_AND_ASSIGN(WidgetWinTest); + DISALLOW_COPY_AND_ASSIGN(NativeWidgetWinTest); }; -WidgetWin* WidgetWinTest::CreateWidgetWin() { - scoped_ptr<WidgetWin> window(new WidgetWin()); +NativeWidgetWin* NativeWidgetWinTest::CreateNativeWidgetWin() { + scoped_ptr<NativeWidgetWin> window(new NativeWidgetWin); window->set_delete_on_destroy(false); window->set_window_style(WS_OVERLAPPEDWINDOW); window->Init(NULL, gfx::Rect(50, 50, 650, 650)); return window.release(); } -TEST_F(WidgetWinTest, ZoomWindow) { - scoped_ptr<WidgetWin> window(CreateWidgetWin()); +TEST_F(NativeWidgetWinTest, ZoomWindow) { + scoped_ptr<NativeWidgetWin> window(CreateNativeWidgetWin()); window->ShowWindow(SW_HIDE); EXPECT_FALSE(window->IsActive()); window->ShowWindow(SW_MAXIMIZE); @@ -59,13 +59,13 @@ TEST_F(WidgetWinTest, ZoomWindow) { window->CloseNow(); } -TEST_F(WidgetWinTest, SetBoundsForZoomedWindow) { - scoped_ptr<WidgetWin> window(CreateWidgetWin()); +TEST_F(NativeWidgetWinTest, SetBoundsForZoomedWindow) { + scoped_ptr<NativeWidgetWin> window(CreateNativeWidgetWin()); window->ShowWindow(SW_MAXIMIZE); EXPECT_TRUE(window->IsZoomed()); // Create another window, so that it will be active. - scoped_ptr<WidgetWin> window2(CreateWidgetWin()); + scoped_ptr<NativeWidgetWin> window2(CreateNativeWidgetWin()); window2->ShowWindow(SW_MAXIMIZE); EXPECT_TRUE(window2->IsActive()); EXPECT_FALSE(window->IsActive()); diff --git a/views/window/window_win.cc b/views/window/window_win.cc index fdca1e9..e5c0e19 100644 --- a/views/window/window_win.cc +++ b/views/window/window_win.cc @@ -224,7 +224,7 @@ Window* Window::CreateChromeWindow(gfx::NativeWindow parent, gfx::Rect WindowWin::GetBounds() const { gfx::Rect bounds; - WidgetWin::GetBounds(&bounds, true); + NativeWidgetWin::GetBounds(&bounds, true); return bounds; } @@ -274,11 +274,11 @@ void WindowWin::HideWindow() { } void WindowWin::SetNativeWindowProperty(const char* name, void* value) { - WidgetWin::SetNativeWindowProperty(name, value); + NativeWidgetWin::SetNativeWindowProperty(name, value); } void* WindowWin::GetNativeWindowProperty(const char* name) { - return WidgetWin::GetNativeWindowProperty(name); + return NativeWidgetWin::GetNativeWindowProperty(name); } void WindowWin::PushForceHidden() { @@ -345,7 +345,7 @@ void WindowWin::Close() { if (non_client_view_->CanClose()) { SaveWindowPosition(); RestoreEnabledIfNecessary(); - WidgetWin::Close(); + NativeWidgetWin::Close(); // If the user activates another app after opening us, then comes back and // closes us, we want our owner to gain activation. But only if the owner // is visible. If we don't manually force that here, the other app will @@ -572,7 +572,7 @@ gfx::NativeWindow WindowWin::GetNativeWindow() const { bool WindowWin::ShouldUseNativeFrame() const { ui::ThemeProvider* tp = GetThemeProvider(); if (!tp) - return WidgetWin::IsAeroGlassEnabled(); + return NativeWidgetWin::IsAeroGlassEnabled(); return tp->ShouldUseNativeFrame(); } @@ -627,7 +627,7 @@ gfx::Font WindowWin::GetWindowTitleFont() { // WindowWin, protected: WindowWin::WindowWin(WindowDelegate* window_delegate) - : WidgetWin(), + : NativeWidgetWin(), focus_on_creation_(true), window_delegate_(window_delegate), non_client_view_(new NonClientView(this)), @@ -663,7 +663,7 @@ void WindowWin::Init(HWND parent, const gfx::Rect& bounds) { // return NULL. owning_hwnd_ = parent; // We call this after initializing our members since our implementations of - // assorted WidgetWin functions may be called during initialization. + // assorted NativeWidgetWin functions may be called during initialization. is_modal_ = window_delegate_->IsModal(); if (is_modal_) BecomeModal(); @@ -673,13 +673,13 @@ void WindowWin::Init(HWND parent, const gfx::Rect& bounds) { if (window_ex_style() == 0) set_window_ex_style(CalculateWindowExStyle()); - WidgetWin::Init(parent, bounds); + NativeWidgetWin::Init(parent, bounds); ui::SetWindowUserData(GetNativeView(), this); // Create the ClientView, add it to the NonClientView and add the // NonClientView to the RootView. This will cause everything to be parented. non_client_view_->set_client_view(window_delegate_->CreateClientView(this)); - WidgetWin::SetContentsView(non_client_view_); + NativeWidgetWin::SetContentsView(non_client_view_); UpdateWindowTitle(); UpdateAccessibleRole(); @@ -700,7 +700,7 @@ void WindowWin::SizeWindowToDefault() { gfx::Insets WindowWin::GetClientAreaInsets() const { // Returning an empty Insets object causes the default handling in - // WidgetWin::OnNCCalcSize() to be invoked. + // NativeWidgetWin::OnNCCalcSize() to be invoked. if (GetNonClientView()->UseNativeFrame()) return gfx::Insets(); @@ -726,7 +726,7 @@ gfx::Insets WindowWin::GetClientAreaInsets() const { } /////////////////////////////////////////////////////////////////////////////// -// WindowWin, WidgetWin overrides: +// WindowWin, NativeWidgetWin overrides: void WindowWin::OnActivate(UINT action, BOOL minimized, HWND window) { if (action == WA_INACTIVE) @@ -750,7 +750,7 @@ LRESULT WindowWin::OnAppCommand(HWND window, short app_command, WORD device, // We treat APPCOMMAND ids as an extension of our command namespace, and just // let the delegate figure out what to do... if (!window_delegate_->ExecuteWindowsCommand(app_command)) - return WidgetWin::OnAppCommand(window, app_command, device, keystate); + return NativeWidgetWin::OnAppCommand(window, app_command, device, keystate); return 0; } @@ -759,14 +759,14 @@ void WindowWin::OnCommand(UINT notification_code, int command_id, HWND window) { // should ignore it. if (notification_code > 1 || window_delegate_->ExecuteWindowsCommand(command_id)) { - WidgetWin::OnCommand(notification_code, command_id, window); + NativeWidgetWin::OnCommand(notification_code, command_id, window); } } void WindowWin::OnDestroy() { non_client_view_->WindowClosing(); RestoreEnabledIfNecessary(); - WidgetWin::OnDestroy(); + NativeWidgetWin::OnDestroy(); } LRESULT WindowWin::OnDwmCompositionChanged(UINT msg, WPARAM w_param, @@ -786,14 +786,14 @@ void WindowWin::OnFinalMessage(HWND window) { // messages. window_delegate_->DeleteDelegate(); window_delegate_ = NULL; - WidgetWin::OnFinalMessage(window); + NativeWidgetWin::OnFinalMessage(window); } void WindowWin::OnGetMinMaxInfo(MINMAXINFO* minmax_info) { gfx::Size min_window_size(GetNonClientView()->GetMinimumSize()); minmax_info->ptMinTrackSize.x = min_window_size.width(); minmax_info->ptMinTrackSize.y = min_window_size.height(); - WidgetWin::OnGetMinMaxInfo(minmax_info); + NativeWidgetWin::OnGetMinMaxInfo(minmax_info); } namespace { @@ -807,7 +807,7 @@ void WindowWin::OnInitMenu(HMENU menu) { // We only need to manually enable the system menu if we're not using a native // frame. if (non_client_view_->UseNativeFrame()) - WidgetWin::OnInitMenu(menu); + NativeWidgetWin::OnInitMenu(menu); bool is_fullscreen = IsFullscreen(); bool is_minimized = IsMinimized(); @@ -889,7 +889,7 @@ LRESULT WindowWin::OnNCCalcSize(BOOL mode, LPARAM l_param) { // custom width, but in fullscreen mode we want a custom width of 0. gfx::Insets insets = GetClientAreaInsets(); if (insets.empty() && !IsFullscreen()) - return WidgetWin::OnNCCalcSize(mode, l_param); + return NativeWidgetWin::OnNCCalcSize(mode, l_param); RECT* client_rect = mode ? &reinterpret_cast<NCCALCSIZE_PARAMS*>(l_param)->rgrc[0] : @@ -974,7 +974,7 @@ LRESULT WindowWin::OnNCHitTest(const CPoint& point) { // Otherwise, we let Windows do all the native frame non-client handling for // us. - return WidgetWin::OnNCHitTest(point); + return NativeWidgetWin::OnNCHitTest(point); } namespace { @@ -1011,7 +1011,7 @@ void WindowWin::OnNCPaint(HRGN rgn) { // It's required to avoid some native painting artifacts from appearing when // the window is resized. if (non_client_view_->UseNativeFrame()) { - WidgetWin::OnNCPaint(rgn); + NativeWidgetWin::OnNCPaint(rgn); return; } @@ -1113,13 +1113,13 @@ void WindowWin::OnNCLButtonDown(UINT ht_component, const CPoint& point) { } } - WidgetWin::OnNCLButtonDown(ht_component, point); + NativeWidgetWin::OnNCLButtonDown(ht_component, point); /* TODO(beng): Fix the standard non-client over-painting bug. This code doesn't work but identifies the problem. if (!IsMsgHandled()) { // WindowWin::OnNCLButtonDown set the message as unhandled. This normally - // means WidgetWin::ProcessWindowMessage will pass it to + // means NativeWidgetWin::ProcessWindowMessage will pass it to // DefWindowProc. Sadly, DefWindowProc for WM_NCLBUTTONDOWN does weird // non-client painting, so we need to call it directly here inside a // scoped update lock. @@ -1140,7 +1140,7 @@ void WindowWin::OnNCRButtonDown(UINT ht_component, const CPoint& point) { SetCapture(); } - WidgetWin::OnNCRButtonDown(ht_component, point); + NativeWidgetWin::OnNCRButtonDown(ht_component, point); } void WindowWin::OnRButtonUp(UINT ht_component, const CPoint& point) { @@ -1165,7 +1165,7 @@ void WindowWin::OnRButtonUp(UINT ht_component, const CPoint& point) { } } - WidgetWin::OnRButtonUp(ht_component, point); + NativeWidgetWin::OnRButtonUp(ht_component, point); } LRESULT WindowWin::OnNCUAHDrawCaption(UINT msg, WPARAM w_param, @@ -1206,7 +1206,7 @@ void WindowWin::OnSettingChange(UINT flags, const wchar_t* section) { SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE | SWP_NOOWNERZORDER); SetMsgHandled(TRUE); } else { - WidgetWin::OnSettingChange(flags, section); + NativeWidgetWin::OnSettingChange(flags, section); } } @@ -1339,7 +1339,7 @@ void WindowWin::OnWindowPosChanging(WINDOWPOS* window_pos) { } } - WidgetWin::OnWindowPosChanging(window_pos); + NativeWidgetWin::OnWindowPosChanging(window_pos); } gfx::Size WindowWin::GetRootViewSize() const { @@ -1347,7 +1347,7 @@ gfx::Size WindowWin::GetRootViewSize() const { // determined by the relevant WM_NCCALCSIZE handling, so we just use the // default handling which does this. if (GetNonClientView()->UseNativeFrame() || IsMaximized()) - return WidgetWin::GetRootViewSize(); + return NativeWidgetWin::GetRootViewSize(); // When using an opaque frame, we consider the entire window rect to be client // area visually. diff --git a/views/window/window_win.h b/views/window/window_win.h index 5cd2bdd..4542383 100644 --- a/views/window/window_win.h +++ b/views/window/window_win.h @@ -6,7 +6,7 @@ #define VIEWS_WINDOW_WINDOW_WIN_H_ #pragma once -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" #include "views/window/window.h" namespace gfx { @@ -31,15 +31,14 @@ void EnsureRectIsVisibleInRect(const gfx::Rect& parent_rect, class Client; class WindowDelegate; -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // // WindowWin // -// A WindowWin is a WidgetWin that has a caption and a border. The frame is -// rendered by the operating system. +// A WindowWin is a NativeWidgetWin that represents a Window. // -/////////////////////////////////////////////////////////////////////////////// -class WindowWin : public WidgetWin, +//////////////////////////////////////////////////////////////////////////////// +class WindowWin : public NativeWidgetWin, public Window { public: virtual ~WindowWin(); @@ -124,7 +123,7 @@ class WindowWin : public WidgetWin, // crazily complicated. virtual gfx::Insets GetClientAreaInsets() const; - // Overridden from WidgetWin: + // Overridden from NativeWidgetWin: virtual void OnActivate(UINT action, BOOL minimized, HWND window); virtual void OnActivateApp(BOOL active, DWORD thread_id); virtual LRESULT OnAppCommand(HWND window, short app_command, WORD device, |