diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-14 02:49:59 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-14 02:49:59 +0000 |
commit | 6b33e4da472b3c474a3f1328fdba4a84d4a91886 (patch) | |
tree | 60b1bdfdba96c65bfa671e98d7c4c2392f49593f /chrome/browser/views | |
parent | d0769df5d494568b24f77a54409ec8539bba4cf3 (diff) | |
download | chromium_src-6b33e4da472b3c474a3f1328fdba4a84d4a91886.zip chromium_src-6b33e4da472b3c474a3f1328fdba4a84d4a91886.tar.gz chromium_src-6b33e4da472b3c474a3f1328fdba4a84d4a91886.tar.bz2 |
Rename Window->WindowWin
Pull basic Window interface out of WindowWin into new interface, Window.
Convert code to use it.
Review URL: http://codereview.chromium.org/42201
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11695 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
25 files changed, 75 insertions, 68 deletions
diff --git a/chrome/browser/views/about_chrome_view.cc b/chrome/browser/views/about_chrome_view.cc index 91c10e0..c997c1d 100644 --- a/chrome/browser/views/about_chrome_view.cc +++ b/chrome/browser/views/about_chrome_view.cc @@ -784,7 +784,7 @@ void AboutChromeView::UpdateStatus(GoogleUpdateUpgradeResult result, new_version_available_); update_label_.SetText(update_string); show_success_indicator = true; - RestartMessageBox::ShowMessageBox(window()->GetNativeView()); + RestartMessageBox::ShowMessageBox(window()->GetNativeWindow()); break; } case UPGRADE_ERROR: diff --git a/chrome/browser/views/about_ipc_dialog.cc b/chrome/browser/views/about_ipc_dialog.cc index 673661d..6e9848c 100644 --- a/chrome/browser/views/about_ipc_dialog.cc +++ b/chrome/browser/views/about_ipc_dialog.cc @@ -26,6 +26,7 @@ #include "chrome/common/render_messages.h" #include "chrome/views/grid_layout.h" #include "chrome/views/text_button.h" +#include "chrome/views/widget.h" #include "chrome/views/window.h" #include "net/url_request/url_request.h" #include "net/url_request/url_request_job.h" diff --git a/chrome/browser/views/bookmark_editor_view.cc b/chrome/browser/views/bookmark_editor_view.cc index 6810d63..8b803bb 100644 --- a/chrome/browser/views/bookmark_editor_view.cc +++ b/chrome/browser/views/bookmark_editor_view.cc @@ -16,6 +16,7 @@ #include "chrome/views/focus_manager.h" #include "chrome/views/grid_layout.h" #include "chrome/views/label.h" +#include "chrome/views/widget.h" #include "chrome/views/window.h" #include "googleurl/src/gurl.h" #include "grit/chromium_strings.h" diff --git a/chrome/browser/views/bookmark_manager_view.cc b/chrome/browser/views/bookmark_manager_view.cc index fb868c2..a0de947 100644 --- a/chrome/browser/views/bookmark_manager_view.cc +++ b/chrome/browser/views/bookmark_manager_view.cc @@ -30,6 +30,7 @@ #include "chrome/views/label.h" #include "chrome/views/menu_button.h" #include "chrome/views/single_split_view.h" +#include "chrome/views/widget.h" #include "chrome/views/window.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" diff --git a/chrome/browser/views/constrained_window_impl.cc b/chrome/browser/views/constrained_window_impl.cc index 3d0869a..8ffd4e0 100644 --- a/chrome/browser/views/constrained_window_impl.cc +++ b/chrome/browser/views/constrained_window_impl.cc @@ -368,7 +368,7 @@ int ConstrainedWindowFrameView::NonClientHitTest(const gfx::Point& point) { if (!bounds().Contains(point)) return HTNOWHERE; - int frame_component = container_->client_view()->NonClientHitTest(point); + int frame_component = container_->GetClientView()->NonClientHitTest(point); if (frame_component != HTNOWHERE) return frame_component; @@ -378,7 +378,7 @@ int ConstrainedWindowFrameView::NonClientHitTest(const gfx::Point& point) { int window_component = GetHTComponentForFrame(point, FrameBorderThickness(), NonClientBorderThickness(), kResizeAreaCornerSize, kResizeAreaCornerSize, - container_->window_delegate()->CanResize()); + container_->GetDelegate()->CanResize()); // Fall back to the caption if no other component matches. return (window_component == HTNOWHERE) ? HTCAPTION : window_component; } @@ -606,10 +606,6 @@ views::NonClientFrameView* ConstrainedWindowImpl::CreateFrameViewForWindow() { return new ConstrainedWindowFrameView(this); } -void ConstrainedWindowImpl::UpdateWindowTitle() { - UpdateUI(TabContents::INVALIDATE_TITLE); -} - void ConstrainedWindowImpl::ActivateConstrainedWindow() { // Other pop-ups are simply moved to the front of the z-order. SetWindowPos(HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); @@ -653,8 +649,8 @@ void ConstrainedWindowImpl::DidBecomeSelected() { std::wstring ConstrainedWindowImpl::GetWindowTitle() const { std::wstring display_title; - if (window_delegate()) - display_title = window_delegate()->GetWindowTitle(); + if (GetDelegate()) + display_title = GetDelegate()->GetWindowTitle(); else display_title = L"Untitled"; @@ -671,9 +667,9 @@ const gfx::Rect& ConstrainedWindowImpl::GetCurrentBounds() const { ConstrainedWindowImpl::ConstrainedWindowImpl( TabContents* owner, views::WindowDelegate* window_delegate) - : Window(window_delegate), + : WindowWin(window_delegate), owner_(owner) { - non_client_view_->SetFrameView(CreateFrameViewForWindow()); + GetNonClientView()->SetFrameView(CreateFrameViewForWindow()); Init(); } @@ -685,7 +681,7 @@ void ConstrainedWindowImpl::Init() { } void ConstrainedWindowImpl::InitAsDialog(const gfx::Rect& initial_bounds) { - Window::Init(owner_->GetNativeView(), initial_bounds); + WindowWin::Init(owner_->GetNativeView(), initial_bounds); ActivateConstrainedWindow(); } @@ -719,7 +715,7 @@ void ConstrainedWindowImpl::OnDestroy() { } // Make sure we call super so that it can do its cleanup. - Window::OnDestroy(); + WindowWin::OnDestroy(); } void ConstrainedWindowImpl::OnFinalMessage(HWND window) { @@ -727,7 +723,7 @@ void ConstrainedWindowImpl::OnFinalMessage(HWND window) { // list. owner_->WillClose(this); - WidgetWin::OnFinalMessage(window); + WindowWin::OnFinalMessage(window); } LRESULT ConstrainedWindowImpl::OnMouseActivate(HWND window, diff --git a/chrome/browser/views/constrained_window_impl.h b/chrome/browser/views/constrained_window_impl.h index 30e6303..0fb6763 100644 --- a/chrome/browser/views/constrained_window_impl.h +++ b/chrome/browser/views/constrained_window_impl.h @@ -8,7 +8,7 @@ #include "base/gfx/rect.h" #include "chrome/browser/tab_contents/constrained_window.h" #include "chrome/browser/tab_contents/tab_contents_delegate.h" -#include "chrome/views/window.h" +#include "chrome/views/window_win.h" class ConstrainedTabContentsWindowDelegate; class ConstrainedWindowAnimation; @@ -25,7 +25,7 @@ class WindowDelegate; // a child HWND with a custom window frame. // class ConstrainedWindowImpl : public ConstrainedWindow, - public views::Window { + public views::WindowWin { public: virtual ~ConstrainedWindowImpl(); @@ -34,7 +34,6 @@ class ConstrainedWindowImpl : public ConstrainedWindow, // Overridden from views::Window: virtual views::NonClientFrameView* CreateFrameViewForWindow(); - virtual void UpdateWindowTitle(); // Overridden from ConstrainedWindow: virtual void CloseConstrainedWindow(); diff --git a/chrome/browser/views/first_run_customize_view.cc b/chrome/browser/views/first_run_customize_view.cc index 1f8e132..e9ad65e 100644 --- a/chrome/browser/views/first_run_customize_view.cc +++ b/chrome/browser/views/first_run_customize_view.cc @@ -201,7 +201,7 @@ bool FirstRunCustomizeView::Accept() { int browser_selected = import_from_combo_->GetSelectedItem(); FirstRun::ImportSettings(profile_, browser_selected, GetDefaultImportItems(), - window()->GetNativeView()); + window()->GetNativeWindow()); } if (default_browser_->IsSelected()) SetDefaultBrowser(); diff --git a/chrome/browser/views/first_run_view.cc b/chrome/browser/views/first_run_view.cc index 13a10a1..f2df7be 100644 --- a/chrome/browser/views/first_run_view.cc +++ b/chrome/browser/views/first_run_view.cc @@ -150,7 +150,7 @@ void FirstRunView::Layout() { void FirstRunView::OpenCustomizeDialog() { // The customize dialog now owns the importer host object. views::Window::CreateChromeWindow( - window()->GetNativeView(), + window()->GetNativeWindow(), gfx::Rect(), new FirstRunCustomizeView(profile_, importer_host_, @@ -182,7 +182,7 @@ bool FirstRunView::Accept() { SetDefaultBrowser(); // Index 0 is the default browser. FirstRun::ImportSettings(profile_, 0, GetDefaultImportItems(), - window()->GetNativeView()); + window()->GetNativeWindow()); UserMetrics::RecordAction(L"FirstRunDef_Accept", profile_); return true; diff --git a/chrome/browser/views/frame/browser_frame.cc b/chrome/browser/views/frame/browser_frame.cc index 31bf41d..10003af 100644 --- a/chrome/browser/views/frame/browser_frame.cc +++ b/chrome/browser/views/frame/browser_frame.cc @@ -24,11 +24,11 @@ static const int kClientEdgeThickness = 3; // BrowserFrame, public: BrowserFrame::BrowserFrame(BrowserView* browser_view) - : Window(browser_view), + : WindowWin(browser_view), browser_view_(browser_view), frame_initialized_(false) { browser_view_->set_frame(this); - non_client_view_->SetFrameView(CreateFrameViewForWindow()); + GetNonClientView()->SetFrameView(CreateFrameViewForWindow()); // Don't focus anything on creation, selecting a tab will set the focus. set_focus_on_creation(false); } @@ -37,7 +37,7 @@ BrowserFrame::~BrowserFrame() { } void BrowserFrame::Init() { - Window::Init(NULL, gfx::Rect()); + WindowWin::Init(NULL, gfx::Rect()); } int BrowserFrame::GetMinimizeButtonOffset() const { @@ -104,7 +104,7 @@ LRESULT BrowserFrame::OnNCActivate(BOOL active) { // Perform first time initialization of the DWM frame insets, only if we're // using the native frame. - if (non_client_view_->UseNativeFrame() && !frame_initialized_) { + if (GetNonClientView()->UseNativeFrame() && !frame_initialized_) { if (browser_view_->IsBrowserTypeNormal()) { ::SetWindowPos(GetNativeView(), NULL, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_FRAMECHANGED); @@ -113,15 +113,15 @@ LRESULT BrowserFrame::OnNCActivate(BOOL active) { frame_initialized_ = true; } browser_view_->ActivationChanged(!!active); - return Window::OnNCActivate(active); + return WindowWin::OnNCActivate(active); } LRESULT BrowserFrame::OnNCCalcSize(BOOL mode, LPARAM l_param) { // We don't adjust the client area unless we're a tabbed browser window and // are using the native frame. - if (!non_client_view_->UseNativeFrame() || + if (!GetNonClientView()->UseNativeFrame() || !browser_view_->IsBrowserTypeNormal()) { - return Window::OnNCCalcSize(mode, l_param); + return WindowWin::OnNCCalcSize(mode, l_param); } RECT* client_rect = mode ? @@ -173,14 +173,14 @@ LRESULT BrowserFrame::OnNCCalcSize(BOOL mode, LPARAM l_param) { LRESULT BrowserFrame::OnNCHitTest(const CPoint& pt) { // Only do DWM hit-testing when we are using the native frame. - if (non_client_view_->UseNativeFrame()) { + if (GetNonClientView()->UseNativeFrame()) { LRESULT result; if (DwmDefWindowProc(GetNativeView(), WM_NCHITTEST, 0, MAKELPARAM(pt.x, pt.y), &result)) { return result; } } - return Window::OnNCHitTest(pt); + return WindowWin::OnNCHitTest(pt); } /////////////////////////////////////////////////////////////////////////////// @@ -191,7 +191,7 @@ int BrowserFrame::GetShowState() const { } views::NonClientFrameView* BrowserFrame::CreateFrameViewForWindow() { - if (non_client_view_->UseNativeFrame()) + if (GetNonClientView()->UseNativeFrame()) browser_frame_view_ = new GlassBrowserFrameView(this, browser_view_); else browser_frame_view_ = new OpaqueBrowserFrameView(this, browser_view_); @@ -199,7 +199,7 @@ views::NonClientFrameView* BrowserFrame::CreateFrameViewForWindow() { } void BrowserFrame::UpdateFrameAfterFrameChange() { - Window::UpdateFrameAfterFrameChange(); + WindowWin::UpdateFrameAfterFrameChange(); UpdateDWMFrame(); } @@ -213,7 +213,7 @@ views::RootView* BrowserFrame::CreateRootView() { void BrowserFrame::UpdateDWMFrame() { // Nothing to do yet. - if (!client_view() || !browser_view_->IsBrowserTypeNormal()) + if (!GetClientView() || !browser_view_->IsBrowserTypeNormal()) return; // In fullscreen mode, we don't extend glass into the client area at all, diff --git a/chrome/browser/views/frame/browser_frame.h b/chrome/browser/views/frame/browser_frame.h index 7414719..94d099b 100644 --- a/chrome/browser/views/frame/browser_frame.h +++ b/chrome/browser/views/frame/browser_frame.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_VIEWS_FRAME_BROWSER_FRAME_ #define CHROME_BROWSER_VIEWS_FRAME_BROWSER_FRAME_ -#include "chrome/views/window.h" +#include "chrome/views/window_win.h" class AeroGlassNonClientView; class BrowserView; @@ -29,10 +29,10 @@ class BrowserNonClientFrameView : public views::NonClientFrameView { /////////////////////////////////////////////////////////////////////////////// // BrowserFrame // -// BrowserFrame is a Window subclass that provides the window frame for the +// BrowserFrame is a WindowWin subclass that provides the window frame for the // Chrome browser window. // -class BrowserFrame : public views::Window { +class BrowserFrame : public views::WindowWin { public: explicit BrowserFrame(BrowserView* browser_view); virtual ~BrowserFrame(); diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index f8d81d9..062c2e1 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -1088,7 +1088,7 @@ bool BrowserView::GetSavedWindowBounds(gfx::Rect* bounds) const { } gfx::Rect window_rect = - frame_->GetWindowBoundsForClientBounds(*bounds); + frame_->GetNonClientView()->GetWindowBoundsForClientBounds(*bounds); window_rect.set_origin(bounds->origin()); // When we are given x/y coordinates of 0 on a created popup window, diff --git a/chrome/browser/views/frame/glass_browser_frame_view.cc b/chrome/browser/views/frame/glass_browser_frame_view.cc index 40bebe6..c822aa1 100644 --- a/chrome/browser/views/frame/glass_browser_frame_view.cc +++ b/chrome/browser/views/frame/glass_browser_frame_view.cc @@ -115,7 +115,7 @@ GlassBrowserFrameView::GlassBrowserFrameView(BrowserFrame* frame, throbber_running_(false), throbber_frame_(0) { InitClass(); - if (frame_->window_delegate()->ShouldShowWindowIcon()) + if (frame_->GetDelegate()->ShouldShowWindowIcon()) InitThrobberIcons(); } @@ -202,7 +202,7 @@ int GlassBrowserFrameView::NonClientHitTest(const gfx::Point& point) { if (!browser_view_->IsBrowserTypeNormal() || !bounds().Contains(point)) return HTNOWHERE; - int frame_component = frame_->client_view()->NonClientHitTest(point); + int frame_component = frame_->GetClientView()->NonClientHitTest(point); if (frame_component != HTNOWHERE) return frame_component; @@ -210,7 +210,7 @@ int GlassBrowserFrameView::NonClientHitTest(const gfx::Point& point) { int window_component = GetHTComponentForFrame(point, border_thickness, NonClientBorderThickness(), border_thickness, kResizeAreaCornerSize - border_thickness, - frame_->window_delegate()->CanResize()); + frame_->GetDelegate()->CanResize()); // Fall back to the caption if no other component matches. return (window_component == HTNOWHERE) ? HTCAPTION : window_component; } @@ -272,7 +272,7 @@ void GlassBrowserFrameView::PaintDistributorLogo(ChromeCanvas* canvas) { void GlassBrowserFrameView::PaintToolbarBackground(ChromeCanvas* canvas) { gfx::Rect toolbar_bounds(browser_view_->GetToolbarBounds()); gfx::Point toolbar_origin(toolbar_bounds.origin()); - View::ConvertPointToView(frame_->client_view(), this, &toolbar_origin); + View::ConvertPointToView(frame_->GetClientView(), this, &toolbar_origin); toolbar_bounds.set_origin(toolbar_origin); SkBitmap* toolbar_left = @@ -306,7 +306,7 @@ void GlassBrowserFrameView::PaintRestoredClientEdge(ChromeCanvas* canvas) { // The client edges start below the toolbar upper corner images regardless // of how tall the toolbar itself is. int client_area_top = - frame_->client_view()->y() + browser_view_->GetToolbarBounds().y() + + frame_->GetClientView()->y() + browser_view_->GetToolbarBounds().y() + resources_->GetPartBitmap(FRAME_CLIENT_EDGE_TOP_LEFT)->height(); gfx::Rect client_area_bounds = CalculateClientAreaBounds(width(), height()); diff --git a/chrome/browser/views/frame/opaque_browser_frame_view.cc b/chrome/browser/views/frame/opaque_browser_frame_view.cc index 8452a37..01b8632 100644 --- a/chrome/browser/views/frame/opaque_browser_frame_view.cc +++ b/chrome/browser/views/frame/opaque_browser_frame_view.cc @@ -474,7 +474,7 @@ int OpaqueBrowserFrameView::NonClientHitTest(const gfx::Point& point) { if (!bounds().Contains(point)) return HTNOWHERE; - int frame_component = frame_->client_view()->NonClientHitTest(point); + int frame_component = frame_->GetClientView()->NonClientHitTest(point); if (frame_component != HTNOWHERE) return frame_component; @@ -496,7 +496,7 @@ int OpaqueBrowserFrameView::NonClientHitTest(const gfx::Point& point) { int window_component = GetHTComponentForFrame(point, TopResizeHeight(), NonClientBorderThickness(), kResizeAreaCornerSize, kResizeAreaCornerSize, - frame_->window_delegate()->CanResize()); + frame_->GetDelegate()->CanResize()); // Fall back to the caption if no other component matches. return (window_component == HTNOWHERE) ? HTCAPTION : window_component; } @@ -621,13 +621,13 @@ void OpaqueBrowserFrameView::SetAccessibleName(const std::wstring& name) { void OpaqueBrowserFrameView::ButtonPressed(views::BaseButton* sender) { if (sender == minimize_button_) - frame_->ExecuteSystemMenuCommand(SC_MINIMIZE); + frame_->Minimize(); else if (sender == maximize_button_) - frame_->ExecuteSystemMenuCommand(SC_MAXIMIZE); + frame_->Maximize(); else if (sender == restore_button_) - frame_->ExecuteSystemMenuCommand(SC_RESTORE); + frame_->Restore(); else if (sender == close_button_) - frame_->ExecuteSystemMenuCommand(SC_CLOSE); + frame_->Close(); } /////////////////////////////////////////////////////////////////////////////// @@ -642,7 +642,7 @@ bool OpaqueBrowserFrameView::ShouldTabIconViewAnimate() const { } SkBitmap OpaqueBrowserFrameView::GetFavIconForTabIconView() { - return frame_->window_delegate()->GetWindowIcon(); + return frame_->GetDelegate()->GetWindowIcon(); } /////////////////////////////////////////////////////////////////////////////// @@ -663,7 +663,7 @@ int OpaqueBrowserFrameView::NonClientBorderThickness() const { } int OpaqueBrowserFrameView::NonClientTopBorderHeight() const { - if (frame_->window_delegate()->ShouldShowWindowTitle()) { + if (frame_->GetDelegate()->ShouldShowWindowTitle()) { int title_top_spacing, title_thickness; return TitleCoordinates(&title_top_spacing, &title_thickness); } @@ -772,7 +772,7 @@ void OpaqueBrowserFrameView::PaintMaximizedFrameBorder(ChromeCanvas* canvas) { resources()->GetPartBitmap(FRAME_NO_TOOLBAR_TOP_CENTER); int edge_height = top_center->height() - kClientEdgeThickness; canvas->TileImageInt(*top_center, 0, - frame_->client_view()->y() - edge_height, width(), edge_height); + frame_->GetClientView()->y() - edge_height, width(), edge_height); } } @@ -787,7 +787,7 @@ void OpaqueBrowserFrameView::PaintDistributorLogo(ChromeCanvas* canvas) { void OpaqueBrowserFrameView::PaintTitleBar(ChromeCanvas* canvas) { // The window icon is painted by the TabIconView. - views::WindowDelegate* d = frame_->window_delegate(); + views::WindowDelegate* d = frame_->GetDelegate(); if (d->ShouldShowWindowTitle()) { canvas->DrawStringInt(d->GetWindowTitle(), title_font_, SK_ColorWHITE, MirroredLeftPointForRect(title_bounds_), title_bounds_.y(), @@ -807,7 +807,7 @@ void OpaqueBrowserFrameView::PaintToolbarBackground(ChromeCanvas* canvas) { gfx::Rect toolbar_bounds(browser_view_->GetToolbarBounds()); gfx::Point toolbar_origin(toolbar_bounds.origin()); - View::ConvertPointToView(frame_->client_view(), this, &toolbar_origin); + View::ConvertPointToView(frame_->GetClientView(), this, &toolbar_origin); toolbar_bounds.set_origin(toolbar_origin); SkBitmap* toolbar_left = @@ -848,7 +848,7 @@ void OpaqueBrowserFrameView::PaintOTRAvatar(ChromeCanvas* canvas) { } void OpaqueBrowserFrameView::PaintRestoredClientEdge(ChromeCanvas* canvas) { - int client_area_top = frame_->client_view()->y(); + int client_area_top = frame_->GetClientView()->y(); gfx::Rect client_area_bounds = CalculateClientAreaBounds(width(), height()); if (browser_view_->IsToolbarVisible()) { @@ -991,7 +991,7 @@ void OpaqueBrowserFrameView::LayoutTitleBar() { if (!frame_->IsMaximized()) icon_y -= kIconRestoredAdjust; - views::WindowDelegate* d = frame_->window_delegate(); + views::WindowDelegate* d = frame_->GetDelegate(); if (!d->ShouldShowWindowIcon()) icon_size = 0; if (window_icon_) diff --git a/chrome/browser/views/frame/opaque_browser_frame_view.h b/chrome/browser/views/frame/opaque_browser_frame_view.h index d62bf71..ee805f8 100644 --- a/chrome/browser/views/frame/opaque_browser_frame_view.h +++ b/chrome/browser/views/frame/opaque_browser_frame_view.h @@ -112,7 +112,7 @@ class OpaqueBrowserFrameView : public BrowserNonClientFrameView, // Returns the set of resources to use to paint this view. views::WindowResources* resources() const { - return frame_->is_active() || paint_as_active() ? + return frame_->IsActive() || paint_as_active() ? current_active_resources_ : current_inactive_resources_; } diff --git a/chrome/browser/views/hung_renderer_view.cc b/chrome/browser/views/hung_renderer_view.cc index 4dc72f6..ef78677 100644 --- a/chrome/browser/views/hung_renderer_view.cc +++ b/chrome/browser/views/hung_renderer_view.cc @@ -225,7 +225,7 @@ void HungRendererWarningView::ShowForWebContents(WebContents* contents) { HWND frame_hwnd = GetAncestor(contents->GetNativeView(), GA_ROOT); HWND foreground_window = GetForegroundWindow(); if (foreground_window != frame_hwnd && - foreground_window != window()->GetNativeView()) { + foreground_window != window()->GetNativeWindow()) { return; } @@ -403,8 +403,7 @@ gfx::Rect HungRendererWarningView::GetDisplayBounds( CRect contents_bounds; GetWindowRect(contents_hwnd, &contents_bounds); - gfx::Rect window_bounds; - window()->GetBounds(&window_bounds, true); + gfx::Rect window_bounds = window()->GetBounds(); int window_x = contents_bounds.left + (contents_bounds.Width() - window_bounds.width()) / 2; diff --git a/chrome/browser/views/input_window.cc b/chrome/browser/views/input_window.cc index 6add8e8..a2bc55b 100644 --- a/chrome/browser/views/input_window.cc +++ b/chrome/browser/views/input_window.cc @@ -4,6 +4,8 @@ #include "chrome/browser/views/input_window.h" +#include "base/message_loop.h" +#include "base/task.h" #include "chrome/browser/views/standard_layout.h" #include "chrome/common/l10n_util.h" #include "chrome/views/grid_layout.h" @@ -165,6 +167,6 @@ views::Window* CreateInputWindow(HWND parent_hwnd, views::Window* window = views::Window::CreateChromeWindow(parent_hwnd, gfx::Rect(), new ContentView(delegate)); - window->client_view()->AsDialogClientView()->UpdateDialogButtons(); + window->GetClientView()->AsDialogClientView()->UpdateDialogButtons(); return window; } diff --git a/chrome/browser/views/keyword_editor_view.cc b/chrome/browser/views/keyword_editor_view.cc index 86c93eb7..a19a3ce 100644 --- a/chrome/browser/views/keyword_editor_view.cc +++ b/chrome/browser/views/keyword_editor_view.cc @@ -25,6 +25,7 @@ #include "chrome/views/dialog_delegate.h" #include "chrome/views/grid_layout.h" #include "chrome/views/text_field.h" +#include "chrome/views/widget.h" #include "chrome/views/window.h" #include "googleurl/src/gurl.h" #include "grit/generated_resources.h" diff --git a/chrome/browser/views/options/advanced_contents_view.cc b/chrome/browser/views/options/advanced_contents_view.cc index cc44291..d3e46b2 100644 --- a/chrome/browser/views/options/advanced_contents_view.cc +++ b/chrome/browser/views/options/advanced_contents_view.cc @@ -38,6 +38,7 @@ #include "chrome/views/combo_box.h" #include "chrome/views/grid_layout.h" #include "chrome/views/scroll_view.h" +#include "chrome/views/widget.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" diff --git a/chrome/browser/views/options/cookies_view.h b/chrome/browser/views/options/cookies_view.h index 6d829bb..503bbfa 100644 --- a/chrome/browser/views/options/cookies_view.h +++ b/chrome/browser/views/options/cookies_view.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_VIEWS_OPTIONS_COOKIES_VIEW_H__ #define CHROME_BROWSER_VIEWS_OPTIONS_COOKIES_VIEW_H__ +#include "base/task.h" #include "chrome/views/dialog_delegate.h" #include "chrome/views/native_button.h" #include "chrome/views/table_view.h" diff --git a/chrome/browser/views/page_info_window.cc b/chrome/browser/views/page_info_window.cc index ad7f1cc..99a44c3 100644 --- a/chrome/browser/views/page_info_window.cc +++ b/chrome/browser/views/page_info_window.cc @@ -670,7 +670,7 @@ void PageInfoWindow::ShowCertDialog(int cert_id) { view_info.dwSize = sizeof(view_info); // We set our parent to the tab window. This makes the cert dialog created // in CryptUIDlgViewCertificate modal to the browser. - view_info.hwndParent = window()->owning_window(); + view_info.hwndParent = window()->GetNativeWindow(); view_info.dwFlags = CRYPTUI_DISABLE_EDITPROPERTIES | CRYPTUI_DISABLE_ADDTOSTORE; view_info.pCertContext = cert->os_cert_handle(); diff --git a/chrome/browser/views/shelf_item_dialog.cc b/chrome/browser/views/shelf_item_dialog.cc index 162076b..eed4742 100644 --- a/chrome/browser/views/shelf_item_dialog.cc +++ b/chrome/browser/views/shelf_item_dialog.cc @@ -21,6 +21,7 @@ #include "chrome/views/grid_layout.h" #include "chrome/views/label.h" #include "chrome/views/text_field.h" +#include "chrome/views/widget.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" #include "grit/theme_resources.h" diff --git a/chrome/browser/views/tabs/tab_renderer.cc b/chrome/browser/views/tabs/tab_renderer.cc index f1c0e07..654acea 100644 --- a/chrome/browser/views/tabs/tab_renderer.cc +++ b/chrome/browser/views/tabs/tab_renderer.cc @@ -15,6 +15,8 @@ #include "chrome/common/l10n_util.h" #include "chrome/common/resource_bundle.h" #include "chrome/common/win_util.h" +#include "chrome/views/non_client_view.h" +#include "chrome/views/widget.h" #include "chrome/views/window.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" @@ -499,7 +501,7 @@ void TabRenderer::OnMouseExited(const views::MouseEvent& e) { void TabRenderer::ThemeChanged() { if (GetWidget() && GetWidget()->AsWindow()) - LoadTabImages(GetWidget()->AsWindow()->UseNativeFrame()); + LoadTabImages(GetWidget()->AsWindow()->GetNonClientView()->UseNativeFrame()); View::ThemeChanged(); } @@ -534,7 +536,7 @@ void TabRenderer::PaintTabBackground(ChromeCanvas* canvas) { animation = pulse_animation_.get(); if (animation->GetCurrentValue() > 0) { PaintHoverTabBackground(canvas, animation->GetCurrentValue() * - (GetWidget()->AsWindow()->UseNativeFrame() ? + (GetWidget()->AsWindow()->GetNonClientView()->UseNativeFrame() ? kHoverOpacityVista : kHoverOpacity)); } else { PaintInactiveTabBackground(canvas); diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc index 7b26c78..d2d4beb 100644 --- a/chrome/browser/views/tabs/tab_strip.cc +++ b/chrome/browser/views/tabs/tab_strip.cc @@ -25,6 +25,7 @@ #include "chrome/common/win_util.h" #include "chrome/views/image_view.h" #include "chrome/views/painter.h" +#include "chrome/views/non_client_view.h" #include "chrome/views/window.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" @@ -598,7 +599,7 @@ void TabStrip::PaintChildren(ChromeCanvas* canvas) { } } - if (GetWidget()->AsWindow()->UseNativeFrame()) { + if (GetWidget()->AsWindow()->GetNonClientView()->UseNativeFrame()) { // Make sure unselected tabs are somewhat transparent. SkPaint paint; paint.setColor(SkColorSetARGB(200, 255, 255, 255)); diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc index 6b8e048..02495fc 100644 --- a/chrome/browser/views/toolbar_view.cc +++ b/chrome/browser/views/toolbar_view.cc @@ -354,7 +354,7 @@ void BrowserToolbarView::Paint(ChromeCanvas* canvas) { // For glass, we need to draw a black line below the location bar to separate // it from the content area. For non-glass, the NonClientView draws the // toolbar background below the location bar for us. - if (GetWidget()->AsWindow()->UseNativeFrame()) + if (GetWidget()->AsWindow()->GetNonClientView()->UseNativeFrame()) canvas->FillRectInt(SK_ColorBLACK, 0, height() - 1, width(), 1); } @@ -498,8 +498,8 @@ gfx::Size BrowserToolbarView::GetPreferredSize() { } int vertical_spacing = PopupTopSpacing() + - (GetWidget()->AsWindow()->UseNativeFrame() ? kPopupBottomSpacingGlass - : kPopupBottomSpacingNonGlass); + (GetWidget()->AsWindow()->GetNonClientView()->UseNativeFrame() ? + kPopupBottomSpacingGlass : kPopupBottomSpacingNonGlass); return gfx::Size(0, location_bar_->GetPreferredSize().height() + vertical_spacing); } @@ -810,8 +810,8 @@ void BrowserToolbarView::ButtonPressed(views::BaseButton* sender) { // static int BrowserToolbarView::PopupTopSpacing() { - return GetWidget()->AsWindow()->UseNativeFrame() ? 0 - : kPopupTopSpacingNonGlass; + return GetWidget()->AsWindow()->GetNonClientView()->UseNativeFrame() ? + 0 : kPopupTopSpacingNonGlass; } void BrowserToolbarView::Observe(NotificationType type, diff --git a/chrome/browser/views/user_data_dir_dialog.cc b/chrome/browser/views/user_data_dir_dialog.cc index bc0db29..f6f814d 100644 --- a/chrome/browser/views/user_data_dir_dialog.cc +++ b/chrome/browser/views/user_data_dir_dialog.cc @@ -6,6 +6,7 @@ #include "chrome/browser/views/user_data_dir_dialog.h" #include "chrome/common/l10n_util.h" #include "chrome/views/message_box_view.h" +#include "chrome/views/widget.h" #include "chrome/views/window.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" |