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

Unified Diff: ui/views/window/dialog_frame_view.cc

Issue 11571023: Move ash/wm's DialogFrameView to ui/views/window; etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove redundant GetContentsView() OVERRIDEs; re-git-add dialog_frame_view files. Created 8 years 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
« ui/views/window/dialog_delegate.h ('K') | « ui/views/window/dialog_frame_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/window/dialog_frame_view.cc
diff --git a/ash/wm/dialog_frame_view.cc b/ui/views/window/dialog_frame_view.cc
similarity index 86%
rename from ash/wm/dialog_frame_view.cc
rename to ui/views/window/dialog_frame_view.cc
index 0f47e937c8fb2fb64aaf58344cd3d59df5356027..06706d7f13bd691a9603a60339a8d9f1b1d5a487 100644
--- a/ash/wm/dialog_frame_view.cc
+++ b/ui/views/window/dialog_frame_view.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 "ash/wm/dialog_frame_view.h"
+#include "ui/views/window/dialog_frame_view.h"
#include "grit/ui_resources.h"
#include "ui/base/hit_test.h"
@@ -49,30 +49,28 @@ const int kCloseButtonSize = 44;
} // namespace
-namespace ash {
-namespace internal {
+namespace views {
// static
-const char DialogFrameView::kViewClassName[] = "ash/wm/DialogFrameView";
+const char DialogFrameView::kViewClassName[] = "ui/views/DialogFrameView";
////////////////////////////////////////////////////////////////////////////////
// DialogFrameView, public:
DialogFrameView::DialogFrameView() {
- set_background(views::Background::CreateSolidBackground(
- kDialogBackgroundColor));
+ set_background(Background::CreateSolidBackground(kDialogBackgroundColor));
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
title_font_.reset(new gfx::Font(rb.GetFont(ui::ResourceBundle::MediumFont)));
close_button_ = new views::ImageButton(this);
close_button_->SetImage(views::CustomButton::STATE_NORMAL,
rb.GetImageNamed(IDR_CLOSE_BAR).ToImageSkia());
- close_button_->SetImage(views::CustomButton::STATE_HOVERED,
+ close_button_->SetImage(CustomButton::STATE_HOVERED,
rb.GetImageNamed(IDR_CLOSE_BAR_H).ToImageSkia());
- close_button_->SetImage(views::CustomButton::STATE_PRESSED,
+ close_button_->SetImage(CustomButton::STATE_PRESSED,
rb.GetImageNamed(IDR_CLOSE_BAR_P).ToImageSkia());
- close_button_->SetImageAlignment(views::ImageButton::ALIGN_CENTER,
- views::ImageButton::ALIGN_MIDDLE);
+ close_button_->SetImageAlignment(ImageButton::ALIGN_CENTER,
+ ImageButton::ALIGN_MIDDLE);
AddChildView(close_button_);
}
@@ -80,7 +78,7 @@ DialogFrameView::~DialogFrameView() {
}
////////////////////////////////////////////////////////////////////////////////
-// DialogFrameView, views::NonClientFrameView:
+// DialogFrameView, NonClientFrameView:
gfx::Rect DialogFrameView::GetBoundsForClientView() const {
gfx::Rect client_bounds = GetLocalBounds();
@@ -119,7 +117,7 @@ void DialogFrameView::UpdateWindowTitle() {
}
////////////////////////////////////////////////////////////////////////////////
-// DialogFrameView, views::View overrides:
+// DialogFrameView, View overrides:
std::string DialogFrameView::GetClassName() const {
return kViewClassName;
@@ -138,8 +136,8 @@ void DialogFrameView::Layout() {
}
void DialogFrameView::OnPaint(gfx::Canvas* canvas) {
- views::View::OnPaint(canvas);
- views::WidgetDelegate* delegate = GetWidget()->widget_delegate();
+ View::OnPaint(canvas);
+ WidgetDelegate* delegate = GetWidget()->widget_delegate();
if (!delegate)
return;
canvas->DrawStringInt(delegate->GetWindowTitle(), *title_font_.get(),
@@ -147,10 +145,9 @@ void DialogFrameView::OnPaint(gfx::Canvas* canvas) {
}
////////////////////////////////////////////////////////////////////////////////
-// DialogFrameView, views::ButtonListener overrides:
+// DialogFrameView, ButtonListener overrides:
-void DialogFrameView::ButtonPressed(views::Button* sender,
- const ui::Event& event) {
+void DialogFrameView::ButtonPressed(Button* sender, const ui::Event& event) {
if (sender == close_button_)
GetWidget()->Close();
}
@@ -189,5 +186,4 @@ gfx::Insets DialogFrameView::GetClientInsets() const {
return insets;
}
-} // namespace internal
} // namespace views
« ui/views/window/dialog_delegate.h ('K') | « ui/views/window/dialog_frame_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698