diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-14 07:22:13 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-14 07:22:13 +0000 |
commit | af38e14a94b83471f75717b85bfabe56864159d3 (patch) | |
tree | a1673088ce567ba72e0a0932ffad3889f41c4548 /chrome/browser/views/frame | |
parent | 5cbd55c5e7a859e05d1c7f17d9fdc229a12a3244 (diff) | |
download | chromium_src-af38e14a94b83471f75717b85bfabe56864159d3.zip chromium_src-af38e14a94b83471f75717b85bfabe56864159d3.tar.gz chromium_src-af38e14a94b83471f75717b85bfabe56864159d3.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/46079
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11699 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/frame')
-rw-r--r-- | chrome/browser/views/frame/browser_frame.cc | 24 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_frame.h | 6 | ||||
-rw-r--r-- | chrome/browser/views/frame/glass_browser_frame_view.cc | 10 | ||||
-rw-r--r-- | chrome/browser/views/frame/opaque_browser_frame_view.cc | 26 | ||||
-rw-r--r-- | chrome/browser/views/frame/opaque_browser_frame_view.h | 2 |
5 files changed, 34 insertions, 34 deletions
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/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_; } |