Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(642)

Unified Diff: views/window/dialog_client_view.cc

Issue 7054052: Move more from Window onto Widget. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/window/dialog_client_view.h ('k') | views/window/dialog_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/window/dialog_client_view.cc
===================================================================
--- views/window/dialog_client_view.cc (revision 88218)
+++ views/window/dialog_client_view.cc (working copy)
@@ -24,8 +24,8 @@
#include "views/controls/button/native_button.h"
#include "views/layout/layout_constants.h"
#include "views/widget/root_view.h"
+#include "views/widget/widget.h"
#include "views/window/dialog_delegate.h"
-#include "views/window/window.h"
#if defined(OS_WIN)
#include "ui/gfx/native_theme.h"
@@ -68,7 +68,7 @@
class DialogButton : public NativeButton {
public:
DialogButton(ButtonListener* listener,
- Window* owner,
+ Widget* owner,
MessageBoxFlags::DialogButton type,
const std::wstring& title,
bool is_default)
@@ -80,7 +80,7 @@
// Overridden to forward to the delegate.
virtual bool AcceleratorPressed(const Accelerator& accelerator) {
- if (!owner_->window_delegate()->AsDialogDelegate()->
+ if (!owner_->widget_delegate()->AsDialogDelegate()->
AreAcceleratorsEnabled(type_)) {
return false;
}
@@ -88,7 +88,7 @@
}
private:
- Window* owner_;
+ Widget* owner_;
const MessageBoxFlags::DialogButton type_;
DISALLOW_COPY_AND_ASSIGN(DialogButton);
@@ -109,7 +109,7 @@
///////////////////////////////////////////////////////////////////////////////
// DialogClientView, public:
-DialogClientView::DialogClientView(Window* owner, View* contents_view)
+DialogClientView::DialogClientView(Widget* owner, View* contents_view)
: ClientView(owner, contents_view),
ok_button_(NULL),
cancel_button_(NULL),
@@ -136,7 +136,7 @@
label = UTF16ToWide(l10n_util::GetStringUTF16(IDS_APP_OK));
bool is_default_button =
(dd->GetDefaultDialogButton() & MessageBoxFlags::DIALOGBUTTON_OK) != 0;
- ok_button_ = new DialogButton(this, window(),
+ ok_button_ = new DialogButton(this, GetWidget(),
MessageBoxFlags::DIALOGBUTTON_OK, label,
is_default_button);
ok_button_->SetGroup(kButtonGroup);
@@ -160,7 +160,7 @@
bool is_default_button =
(dd->GetDefaultDialogButton() & MessageBoxFlags::DIALOGBUTTON_CANCEL)
!= 0;
- cancel_button_ = new DialogButton(this, window(),
+ cancel_button_ = new DialogButton(this, GetWidget(),
MessageBoxFlags::DIALOGBUTTON_CANCEL,
label, is_default_button);
cancel_button_->SetGroup(kButtonGroup);
@@ -284,7 +284,7 @@
return close;
}
-void DialogClientView::WindowClosing() {
+void DialogClientView::WidgetClosing() {
if (listening_to_focus_) {
DCHECK(saved_focus_manager_);
if (saved_focus_manager_)
@@ -321,7 +321,7 @@
void DialogClientView::PaintChildren(gfx::Canvas* canvas) {
View::PaintChildren(canvas);
- if (!window()->IsMaximized() && !window()->IsMinimized())
+ if (!GetWidget()->IsMaximized() && !GetWidget()->IsMinimized())
PaintSizeBox(canvas);
}
@@ -426,8 +426,8 @@
// DialogClientView, private:
void DialogClientView::PaintSizeBox(gfx::Canvas* canvas) {
- if (window()->window_delegate()->CanResize() ||
- window()->window_delegate()->CanMaximize()) {
+ if (GetWidget()->widget_delegate()->CanResize() ||
+ GetWidget()->widget_delegate()->CanMaximize()) {
#if defined(OS_WIN)
gfx::NativeTheme::ExtraParams extra;
gfx::Size gripper_size = gfx::NativeTheme::instance()->GetPartSize(
@@ -539,11 +539,11 @@
}
DialogDelegate* DialogClientView::GetDialogDelegate() const {
- return window()->window_delegate()->AsDialogDelegate();
+ return GetWidget()->widget_delegate()->AsDialogDelegate();
}
void DialogClientView::Close() {
- window()->Close();
+ GetWidget()->Close();
GetDialogDelegate()->OnClose();
}
« no previous file with comments | « views/window/dialog_client_view.h ('k') | views/window/dialog_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698