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

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

Issue 12184004: Replace DialogFrameView with an enhanced BubbleFrameView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup. Created 7 years, 11 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 | « ui/views/window/dialog_delegate.h ('k') | ui/views/window/dialog_frame_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/window/dialog_delegate.cc
diff --git a/ui/views/window/dialog_delegate.cc b/ui/views/window/dialog_delegate.cc
index 711554d6e3ab87c2425b527834ca9a5f97487256..0e4c0f6d718c03be7852f4751a89c0145fc48dd0 100644
--- a/ui/views/window/dialog_delegate.cc
+++ b/ui/views/window/dialog_delegate.cc
@@ -7,11 +7,12 @@
#include "base/command_line.h"
#include "base/logging.h"
#include "ui/base/ui_base_switches.h"
+#include "ui/views/bubble/bubble_border.h"
+#include "ui/views/bubble/bubble_frame_view.h"
#include "ui/views/controls/button/text_button.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_observer.h"
#include "ui/views/window/dialog_client_view.h"
-#include "ui/views/window/dialog_frame_view.h"
namespace views {
@@ -132,8 +133,21 @@ ClientView* DialogDelegate::CreateClientView(Widget* widget) {
}
NonClientFrameView* DialogDelegate::CreateNonClientFrameView(Widget* widget) {
- return UseNewStyle() ? new DialogFrameView(GetWindowTitle()) :
- WidgetDelegate::CreateNonClientFrameView(widget);
+ return UseNewStyle() ? CreateNewStyleFrameView(widget) :
+ WidgetDelegate::CreateNonClientFrameView(widget);
+}
+
+//static
sky 2013/02/04 18:25:35 // static
msw 2013/02/04 18:44:38 Done.
+NonClientFrameView* DialogDelegate::CreateNewStyleFrameView(Widget* widget) {
+ BubbleFrameView* frame = new BubbleFrameView(gfx::Insets(20, 20, 20, 20));
+ const SkColor color = widget->GetNativeTheme()->GetSystemColor(
+ ui::NativeTheme::kColorId_DialogBackground);
+ frame->SetBubbleBorder(
+ new BubbleBorder(BubbleBorder::FLOAT, BubbleBorder::SMALL_SHADOW, color));
+ frame->SetTitle(widget->widget_delegate()->GetWindowTitle());
+ frame->SetShowCloseButton(true);
+ frame->set_can_drag(true);
+ return frame;
}
const DialogClientView* DialogDelegate::GetDialogClientView() const {
« no previous file with comments | « ui/views/window/dialog_delegate.h ('k') | ui/views/window/dialog_frame_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698