summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-19 22:16:28 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-19 22:16:28 +0000
commite838217a07f277f8bf751aaaac6fb1005a533d47 (patch)
treef34f7f4522a9eed3a8172751fb1a3202705c16f6 /chrome/browser/views
parente804e052523e23df3881132ab2e31791e0c0d1b6 (diff)
downloadchromium_src-e838217a07f277f8bf751aaaac6fb1005a533d47.zip
chromium_src-e838217a07f277f8bf751aaaac6fb1005a533d47.tar.gz
chromium_src-e838217a07f277f8bf751aaaac6fb1005a533d47.tar.bz2
GTK: HTTP Auth dialogs under linux.
- Implements a ConstrainedWindowGtk which positions itself in the center of its corresponding TabContentsViewGtk. - Implements LoginPromptGtk. HTTP Auth now works under Linux. - Renames ConstrainedWindowImpl to ConstrainedWindowWin http://crbug.com/11512 Review URL: http://codereview.chromium.org/132047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18864 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r--chrome/browser/views/constrained_window_win.cc (renamed from chrome/browser/views/constrained_window_impl.cc)43
-rw-r--r--chrome/browser/views/constrained_window_win.h (renamed from chrome/browser/views/constrained_window_impl.h)22
2 files changed, 30 insertions, 35 deletions
diff --git a/chrome/browser/views/constrained_window_impl.cc b/chrome/browser/views/constrained_window_win.cc
index 75f3771..f641f6f 100644
--- a/chrome/browser/views/constrained_window_impl.cc
+++ b/chrome/browser/views/constrained_window_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 "chrome/browser/views/constrained_window_impl.h"
+#include "chrome/browser/views/constrained_window_win.h"
#include "app/gfx/canvas.h"
#include "app/gfx/font.h"
@@ -16,7 +16,6 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
-#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_view.h"
#include "chrome/browser/toolbar_model.h"
#include "chrome/browser/views/frame/browser_view.h"
@@ -160,7 +159,7 @@ class ConstrainedWindowFrameView
: public views::NonClientFrameView,
public views::ButtonListener {
public:
- explicit ConstrainedWindowFrameView(ConstrainedWindowImpl* container);
+ explicit ConstrainedWindowFrameView(ConstrainedWindowWin* container);
virtual ~ConstrainedWindowFrameView();
void UpdateWindowTitle();
@@ -223,7 +222,7 @@ class ConstrainedWindowFrameView
// Loads the appropriate set of WindowResources for the frame view.
void InitWindowResources();
- ConstrainedWindowImpl* container_;
+ ConstrainedWindowWin* container_;
scoped_ptr<views::WindowResources> resources_;
@@ -275,7 +274,7 @@ const SkColor kContentsBorderShadow = SkColorSetARGB(51, 0, 0, 0);
// ConstrainedWindowFrameView, public:
ConstrainedWindowFrameView::ConstrainedWindowFrameView(
- ConstrainedWindowImpl* container)
+ ConstrainedWindowWin* container)
: NonClientFrameView(),
container_(container),
close_button_(new views::ImageButton(this)) {
@@ -575,24 +574,24 @@ void ConstrainedWindowFrameView::InitClass() {
}
////////////////////////////////////////////////////////////////////////////////
-// ConstrainedWindowImpl, public:
+// ConstrainedWindowWin, public:
// The space (in pixels) between minimized pop-ups stacked horizontally and
// vertically.
static const int kPopupRepositionOffset = 5;
static const int kConstrainedWindowEdgePadding = 10;
-ConstrainedWindowImpl::~ConstrainedWindowImpl() {
+ConstrainedWindowWin::~ConstrainedWindowWin() {
}
////////////////////////////////////////////////////////////////////////////////
-// ConstrainedWindowImpl, ConstrainedWindow implementation:
+// ConstrainedWindowWin, ConstrainedWindow implementation:
-views::NonClientFrameView* ConstrainedWindowImpl::CreateFrameViewForWindow() {
+views::NonClientFrameView* ConstrainedWindowWin::CreateFrameViewForWindow() {
return new ConstrainedWindowFrameView(this);
}
-void ConstrainedWindowImpl::CloseConstrainedWindow() {
+void ConstrainedWindowWin::CloseConstrainedWindow() {
// Broadcast to all observers of NOTIFY_CWINDOW_CLOSED.
// One example of such an observer is AutomationCWindowTracker in the
// automation component.
@@ -603,7 +602,7 @@ void ConstrainedWindowImpl::CloseConstrainedWindow() {
Close();
}
-std::wstring ConstrainedWindowImpl::GetWindowTitle() const {
+std::wstring ConstrainedWindowWin::GetWindowTitle() const {
std::wstring display_title;
if (GetDelegate())
display_title = GetDelegate()->GetWindowTitle();
@@ -613,14 +612,14 @@ std::wstring ConstrainedWindowImpl::GetWindowTitle() const {
return display_title;
}
-const gfx::Rect& ConstrainedWindowImpl::GetCurrentBounds() const {
+const gfx::Rect& ConstrainedWindowWin::GetCurrentBounds() const {
return current_bounds_;
}
////////////////////////////////////////////////////////////////////////////////
-// ConstrainedWindowImpl, private:
+// ConstrainedWindowWin, private:
-ConstrainedWindowImpl::ConstrainedWindowImpl(
+ConstrainedWindowWin::ConstrainedWindowWin(
TabContents* owner,
views::WindowDelegate* window_delegate)
: WindowWin(window_delegate),
@@ -636,7 +635,7 @@ ConstrainedWindowImpl::ConstrainedWindowImpl(
ActivateConstrainedWindow();
}
-void ConstrainedWindowImpl::ActivateConstrainedWindow() {
+void ConstrainedWindowWin::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);
@@ -659,9 +658,9 @@ void ConstrainedWindowImpl::ActivateConstrainedWindow() {
}
////////////////////////////////////////////////////////////////////////////////
-// ConstrainedWindowImpl, views::WidgetWin overrides:
+// ConstrainedWindowWin, views::WidgetWin overrides:
-void ConstrainedWindowImpl::OnDestroy() {
+void ConstrainedWindowWin::OnDestroy() {
// We do this here, rather than |Close|, since the window may be destroyed in
// a way other than by some other component calling Close, e.g. by the native
// window hierarchy closing. We are guaranteed to receive a WM_DESTROY
@@ -686,7 +685,7 @@ void ConstrainedWindowImpl::OnDestroy() {
WindowWin::OnDestroy();
}
-void ConstrainedWindowImpl::OnFinalMessage(HWND window) {
+void ConstrainedWindowWin::OnFinalMessage(HWND window) {
// Tell our constraining TabContents that we've gone so it can update its
// list.
owner_->WillClose(this);
@@ -694,7 +693,7 @@ void ConstrainedWindowImpl::OnFinalMessage(HWND window) {
WindowWin::OnFinalMessage(window);
}
-LRESULT ConstrainedWindowImpl::OnMouseActivate(HWND window,
+LRESULT ConstrainedWindowWin::OnMouseActivate(HWND window,
UINT hittest_code,
UINT message) {
// We only detach the window if the user clicked on the title bar. That
@@ -708,7 +707,7 @@ LRESULT ConstrainedWindowImpl::OnMouseActivate(HWND window,
return MA_ACTIVATE;
}
-void ConstrainedWindowImpl::OnWindowPosChanged(WINDOWPOS* window_pos) {
+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);
@@ -720,7 +719,7 @@ void ConstrainedWindowImpl::OnWindowPosChanged(WINDOWPOS* window_pos) {
ConstrainedWindow* ConstrainedWindow::CreateConstrainedDialog(
TabContents* parent,
views::WindowDelegate* window_delegate) {
- ConstrainedWindowImpl* window = new ConstrainedWindowImpl(parent,
- window_delegate);
+ ConstrainedWindowWin* window = new ConstrainedWindowWin(parent,
+ window_delegate);
return window;
}
diff --git a/chrome/browser/views/constrained_window_impl.h b/chrome/browser/views/constrained_window_win.h
index 1afd658..a91a736 100644
--- a/chrome/browser/views/constrained_window_impl.h
+++ b/chrome/browser/views/constrained_window_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 CHROME_BROWSER_CONSTRAINED_WINDOW_IMPL_H_
-#define CHROME_BROWSER_CONSTRAINED_WINDOW_IMPL_H_
+#ifndef CHROME_BROWSER_VIEWS_CONSTRAINED_WINDOW_WIN_H_
+#define CHROME_BROWSER_VIEWS_CONSTRAINED_WINDOW_WIN_H_
#include "base/gfx/rect.h"
#include "chrome/browser/tab_contents/constrained_window.h"
@@ -18,15 +18,15 @@ class WindowDelegate;
}
///////////////////////////////////////////////////////////////////////////////
-// ConstrainedWindowImpl
+// ConstrainedWindowWin
//
// A ConstrainedWindow implementation that implements a Constrained Window as
// a child HWND with a custom window frame.
//
-class ConstrainedWindowImpl : public ConstrainedWindow,
+class ConstrainedWindowWin : public ConstrainedWindow,
public views::WindowWin {
public:
- virtual ~ConstrainedWindowImpl();
+ virtual ~ConstrainedWindowWin();
// Returns the TabContents that constrains this Constrained Window.
TabContents* owner() const { return owner_; }
@@ -51,8 +51,8 @@ class ConstrainedWindowImpl : public ConstrainedWindow,
// Use the static factory methods on ConstrainedWindow to construct a
// ConstrainedWindow.
- ConstrainedWindowImpl(TabContents* owner,
- views::WindowDelegate* window_delegate);
+ ConstrainedWindowWin(TabContents* owner,
+ views::WindowDelegate* window_delegate);
// Moves this window to the front of the Z-order and registers us with the
// focus manager.
@@ -65,10 +65,6 @@ class ConstrainedWindowImpl : public ConstrainedWindow,
// when this window is destroyed.
bool focus_restoration_disabled_;
- // true if this window is really a constrained dialog. This is set by
- // InitAsDialog().
- bool is_dialog_;
-
// Current "anchor point", the lower right point at which we render
// the constrained title bar.
gfx::Point anchor_point_;
@@ -76,7 +72,7 @@ class ConstrainedWindowImpl : public ConstrainedWindow,
// Current display rectangle (relative to owner_'s visible area).
gfx::Rect current_bounds_;
- DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowImpl);
+ DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowWin);
};
-#endif // #ifndef CHROME_BROWSER_CONSTRAINED_WINDOW_IMPL_H_
+#endif // #ifndef CHROME_BROWSER_VIEWS_CONSTRAINED_WINDOW_WIN_H_