summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-04 19:33:07 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-04 19:33:07 +0000
commitf5ad16626a1e2c3df0699219118c93bf4048ac59 (patch)
treee3bb0041c3b8930c903f2bc982af01b374413f83
parent5e5d0b040cf338a00a2d87211505276c62598fb3 (diff)
downloadchromium_src-f5ad16626a1e2c3df0699219118c93bf4048ac59.zip
chromium_src-f5ad16626a1e2c3df0699219118c93bf4048ac59.tar.gz
chromium_src-f5ad16626a1e2c3df0699219118c93bf4048ac59.tar.bz2
Rename ConstrainedWindowWin to ConstrainedWindowViews in preparation for refactoring.
BUG=72040 TEST=none TBR=sky Review URL: http://codereview.chromium.org/6735033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80357 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/views/constrained_window_views.cc (renamed from chrome/browser/ui/views/constrained_window_win.cc)61
-rw-r--r--chrome/browser/ui/views/constrained_window_views.h (renamed from chrome/browser/ui/views/constrained_window_win.h)22
-rw-r--r--chrome/chrome_browser.gypi4
-rw-r--r--content/browser/tab_contents/tab_contents.cc6
-rw-r--r--content/browser/tab_contents/tab_contents.h3
5 files changed, 35 insertions, 61 deletions
diff --git a/chrome/browser/ui/views/constrained_window_win.cc b/chrome/browser/ui/views/constrained_window_views.cc
index 3f6f678..a0dca54 100644
--- a/chrome/browser/ui/views/constrained_window_win.cc
+++ b/chrome/browser/ui/views/constrained_window_views.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 "chrome/browser/ui/views/constrained_window_win.h"
+#include "chrome/browser/ui/views/constrained_window_views.h"
#include <algorithm>
@@ -142,7 +142,7 @@ class ConstrainedWindowFrameView
: public views::NonClientFrameView,
public views::ButtonListener {
public:
- explicit ConstrainedWindowFrameView(ConstrainedWindowWin* container);
+ explicit ConstrainedWindowFrameView(ConstrainedWindowViews* container);
virtual ~ConstrainedWindowFrameView();
void UpdateWindowTitle();
@@ -208,7 +208,7 @@ class ConstrainedWindowFrameView
// Loads the appropriate set of WindowResources for the frame view.
void InitWindowResources();
- ConstrainedWindowWin* container_;
+ ConstrainedWindowViews* container_;
scoped_ptr<views::WindowResources> resources_;
@@ -258,7 +258,7 @@ const SkColor kContentsBorderShadow = SkColorSetARGB(51, 0, 0, 0);
// ConstrainedWindowFrameView, public:
ConstrainedWindowFrameView::ConstrainedWindowFrameView(
- ConstrainedWindowWin* container)
+ ConstrainedWindowViews* container)
: NonClientFrameView(),
container_(container),
close_button_(new views::ImageButton(this)) {
@@ -554,19 +554,19 @@ void ConstrainedWindowFrameView::InitClass() {
}
////////////////////////////////////////////////////////////////////////////////
-// ConstrainedWindowWin, public:
+// ConstrainedWindowViews, public:
-ConstrainedWindowWin::~ConstrainedWindowWin() {
+ConstrainedWindowViews::~ConstrainedWindowViews() {
}
////////////////////////////////////////////////////////////////////////////////
-// ConstrainedWindowWin, ConstrainedWindow implementation:
+// ConstrainedWindowViews, ConstrainedWindow implementation:
-views::NonClientFrameView* ConstrainedWindowWin::CreateFrameViewForWindow() {
+views::NonClientFrameView* ConstrainedWindowViews::CreateFrameViewForWindow() {
return new ConstrainedWindowFrameView(this);
}
-void ConstrainedWindowWin::FocusConstrainedWindow() {
+void ConstrainedWindowViews::FocusConstrainedWindow() {
if ((!owner_->delegate() ||
owner_->delegate()->ShouldFocusConstrainedWindow()) &&
window_delegate() && window_delegate()->GetInitiallyFocusedView()) {
@@ -574,7 +574,7 @@ void ConstrainedWindowWin::FocusConstrainedWindow() {
}
}
-void ConstrainedWindowWin::ShowConstrainedWindow() {
+void ConstrainedWindowViews::ShowConstrainedWindow() {
// We marked the view as hidden during construction. Mark it as
// visible now so FocusManager will let us receive focus.
non_client_view()->SetVisible(true);
@@ -584,7 +584,7 @@ void ConstrainedWindowWin::ShowConstrainedWindow() {
FocusConstrainedWindow();
}
-void ConstrainedWindowWin::CloseConstrainedWindow() {
+void ConstrainedWindowViews::CloseConstrainedWindow() {
// Broadcast to all observers of NOTIFY_CWINDOW_CLOSED.
// One example of such an observer is AutomationCWindowTracker in the
// automation component.
@@ -595,7 +595,7 @@ void ConstrainedWindowWin::CloseConstrainedWindow() {
Window::CloseWindow();
}
-std::wstring ConstrainedWindowWin::GetWindowTitle() const {
+std::wstring ConstrainedWindowViews::GetWindowTitle() const {
if (window_delegate())
return window_delegate()->GetWindowTitle();
@@ -604,14 +604,14 @@ std::wstring ConstrainedWindowWin::GetWindowTitle() const {
return std::wstring(L"Untitled");
}
-const gfx::Rect& ConstrainedWindowWin::GetCurrentBounds() const {
+const gfx::Rect& ConstrainedWindowViews::GetCurrentBounds() const {
return current_bounds_;
}
////////////////////////////////////////////////////////////////////////////////
-// ConstrainedWindowWin, private:
+// ConstrainedWindowViews, private:
-ConstrainedWindowWin::ConstrainedWindowWin(
+ConstrainedWindowViews::ConstrainedWindowViews(
TabContents* owner,
views::WindowDelegate* window_delegate)
: WindowWin(window_delegate),
@@ -629,22 +629,15 @@ ConstrainedWindowWin::ConstrainedWindowWin(
WindowWin::Init(owner_->GetNativeView(), gfx::Rect());
}
-void ConstrainedWindowWin::ActivateConstrainedWindow() {
+void ConstrainedWindowViews::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);
}
////////////////////////////////////////////////////////////////////////////////
-// ConstrainedWindowWin, views::WidgetWin overrides:
+// ConstrainedWindowViews, views::WidgetWin overrides:
-void ConstrainedWindowWin::OnDestroy() {
- // TODO(jcampan): figure out focus restoration
-
- // Make sure we call super so that it can do its cleanup.
- WindowWin::OnDestroy();
-}
-
-void ConstrainedWindowWin::OnFinalMessage(HWND window) {
+void ConstrainedWindowViews::OnFinalMessage(HWND window) {
// Tell our constraining TabContents that we've gone so it can update its
// list.
owner_->WillClose(this);
@@ -652,9 +645,9 @@ void ConstrainedWindowWin::OnFinalMessage(HWND window) {
WindowWin::OnFinalMessage(window);
}
-LRESULT ConstrainedWindowWin::OnMouseActivate(UINT message,
- WPARAM w_param,
- LPARAM l_param) {
+LRESULT ConstrainedWindowViews::OnMouseActivate(UINT message,
+ WPARAM w_param,
+ LPARAM l_param) {
// We only detach the window if the user clicked on the title bar. That
// way, users can click inside the contents of legitimate popups obtained
// with a mouse gesture.
@@ -667,19 +660,11 @@ LRESULT ConstrainedWindowWin::OnMouseActivate(UINT message,
return MA_ACTIVATE;
}
-void ConstrainedWindowWin::OnWindowPosChanged(WINDOWPOS* window_pos) {
- // If the window was moved or sized, tell the owner.
- if (!(window_pos->flags & SWP_NOMOVE) || !(window_pos->flags & SWP_NOSIZE))
- owner_->DidMoveOrResize(this);
- WindowWin::OnWindowPosChanged(window_pos);
-}
-
-
// static
ConstrainedWindow* ConstrainedWindow::CreateConstrainedDialog(
TabContents* parent,
views::WindowDelegate* window_delegate) {
- ConstrainedWindowWin* window = new ConstrainedWindowWin(parent,
- window_delegate);
+ ConstrainedWindowViews* window = new ConstrainedWindowViews(parent,
+ window_delegate);
return window;
}
diff --git a/chrome/browser/ui/views/constrained_window_win.h b/chrome/browser/ui/views/constrained_window_views.h
index 1875901..473409e 100644
--- a/chrome/browser/ui/views/constrained_window_win.h
+++ b/chrome/browser/ui/views/constrained_window_views.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 CHROME_BROWSER_UI_VIEWS_CONSTRAINED_WINDOW_WIN_H_
-#define CHROME_BROWSER_UI_VIEWS_CONSTRAINED_WINDOW_WIN_H_
+#ifndef CHROME_BROWSER_UI_VIEWS_CONSTRAINED_WINDOW_VIEWS_H_
+#define CHROME_BROWSER_UI_VIEWS_CONSTRAINED_WINDOW_VIEWS_H_
#pragma once
#include "content/browser/tab_contents/constrained_window.h"
@@ -19,15 +19,15 @@ class WindowDelegate;
}
///////////////////////////////////////////////////////////////////////////////
-// ConstrainedWindowWin
+// ConstrainedWindowViews
//
// A ConstrainedWindow implementation that implements a Constrained Window as
// a child HWND with a custom window frame.
//
-class ConstrainedWindowWin : public ConstrainedWindow,
- public views::WindowWin {
+class ConstrainedWindowViews : public ConstrainedWindow,
+ public views::WindowWin {
public:
- virtual ~ConstrainedWindowWin();
+ virtual ~ConstrainedWindowViews();
// Returns the TabContents that constrains this Constrained Window.
TabContents* owner() const { return owner_; }
@@ -45,20 +45,18 @@ class ConstrainedWindowWin : public ConstrainedWindow,
protected:
// Windows message handlers:
- virtual void OnDestroy() OVERRIDE;
virtual void OnFinalMessage(HWND window) OVERRIDE;
virtual LRESULT OnMouseActivate(UINT message,
WPARAM w_param,
LPARAM l_param) OVERRIDE;
- virtual void OnWindowPosChanged(WINDOWPOS* window_pos) OVERRIDE;
private:
friend class ConstrainedWindow;
// Use the static factory methods on ConstrainedWindow to construct a
// ConstrainedWindow.
- ConstrainedWindowWin(TabContents* owner,
- views::WindowDelegate* window_delegate);
+ ConstrainedWindowViews(TabContents* owner,
+ views::WindowDelegate* window_delegate);
// Moves this window to the front of the Z-order and registers us with the
// focus manager.
@@ -74,7 +72,7 @@ class ConstrainedWindowWin : public ConstrainedWindow,
// Current display rectangle (relative to owner_'s visible area).
gfx::Rect current_bounds_;
- DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowWin);
+ DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowViews);
};
-#endif // CHROME_BROWSER_UI_VIEWS_CONSTRAINED_WINDOW_WIN_H_
+#endif // CHROME_BROWSER_UI_VIEWS_CONSTRAINED_WINDOW_VIEWS_H_
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index ff73ccd..98c3461 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -2815,8 +2815,8 @@
'browser/ui/views/collected_cookies_win.h',
'browser/ui/views/constrained_html_delegate_gtk.cc',
'browser/ui/views/constrained_html_delegate_win.cc',
- 'browser/ui/views/constrained_window_win.cc',
- 'browser/ui/views/constrained_window_win.h',
+ 'browser/ui/views/constrained_window_views.cc',
+ 'browser/ui/views/constrained_window_views.h',
'browser/ui/views/content_setting_bubble_contents.cc',
'browser/ui/views/content_setting_bubble_contents.h',
'browser/ui/views/cookie_info_view.cc',
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index 5940baf..7f152f5 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -1063,12 +1063,6 @@ void TabContents::WillCloseBlockedContentContainer(
PopupNotificationVisibilityChanged(false);
}
-void TabContents::DidMoveOrResize(ConstrainedWindow* window) {
-#if defined(OS_WIN)
- UpdateWindow(GetNativeView());
-#endif
-}
-
void TabContents::OnSavePage() {
// If we can not save the page, try to download it.
if (!SavePackage::IsSavableContents(contents_mime_type())) {
diff --git a/content/browser/tab_contents/tab_contents.h b/content/browser/tab_contents/tab_contents.h
index 33ca959..9aeaf33 100644
--- a/content/browser/tab_contents/tab_contents.h
+++ b/content/browser/tab_contents/tab_contents.h
@@ -474,9 +474,6 @@ class TabContents : public PageNavigator,
// Called when a BlockedContentContainer we own is about to be closed.
void WillCloseBlockedContentContainer(BlockedContentContainer* container);
- // Called when a ConstrainedWindow we own is moved or resized.
- void DidMoveOrResize(ConstrainedWindow* window);
-
// Interstitials -------------------------------------------------------------
// Various other systems need to know about our interstitials.