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

Side by Side Diff: chrome/browser/chromeos/ui/echo_dialog_view.cc

Issue 16374006: Place browser-modal dialogs like web-contents-modal dialogs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes and cleanup. Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/ui/echo_dialog_view.h" 5 #include "chrome/browser/chromeos/ui/echo_dialog_view.h"
6 6
7 #include "chrome/browser/chromeos/ui/echo_dialog_listener.h" 7 #include "chrome/browser/chromeos/ui/echo_dialog_listener.h"
8 #include "chrome/browser/ui/views/constrained_window_views.h"
8 #include "grit/generated_resources.h" 9 #include "grit/generated_resources.h"
9 #include "ui/base/l10n/l10n_util.h" 10 #include "ui/base/l10n/l10n_util.h"
10 #include "ui/gfx/font.h" 11 #include "ui/gfx/font.h"
11 #include "ui/views/controls/styled_label.h" 12 #include "ui/views/controls/styled_label.h"
12 #include "ui/views/widget/widget.h" 13 #include "ui/views/widget/widget.h"
13 #include "ui/views/window/dialog_client_view.h" 14 #include "ui/views/window/dialog_client_view.h"
14 15
15 namespace { 16 namespace {
16 17
17 const int kDialogLabelTopInset = 20; 18 const int kDialogLabelTopInset = 20;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 label_->AddStyleRange(ui::Range(offset, offset + link.length()), link_style); 89 label_->AddStyleRange(ui::Range(offset, offset + link.length()), link_style);
89 90
90 SetLabelBorderAndBounds(); 91 SetLabelBorderAndBounds();
91 92
92 AddChildView(label_); 93 AddChildView(label_);
93 } 94 }
94 95
95 void EchoDialogView::Show(gfx::NativeWindow parent) { 96 void EchoDialogView::Show(gfx::NativeWindow parent) {
96 DCHECK(cancel_button_label_id_); 97 DCHECK(cancel_button_label_id_);
97 98
98 views::DialogDelegate::CreateDialogWidget(this, parent, parent); 99 CreateBrowserModalDialogViews(this, parent);
99 GetWidget()->SetSize(GetWidget()->GetRootView()->GetPreferredSize()); 100 GetWidget()->SetSize(GetWidget()->GetRootView()->GetPreferredSize());
100 GetWidget()->Show(); 101 GetWidget()->Show();
101 } 102 }
102 103
103 int EchoDialogView::GetDefaultDialogButton() const { 104 int EchoDialogView::GetDefaultDialogButton() const {
104 return ui::DIALOG_BUTTON_NONE; 105 return ui::DIALOG_BUTTON_NONE;
105 } 106 }
106 107
107 int EchoDialogView::GetDialogButtons() const { 108 int EchoDialogView::GetDialogButtons() const {
108 int buttons = ui::DIALOG_BUTTON_NONE; 109 int buttons = ui::DIALOG_BUTTON_NONE;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 kDialogLabelBottomInset, 173 kDialogLabelBottomInset,
173 kDialogLabelRightInset)); 174 kDialogLabelRightInset));
174 175
175 label_->SetBounds(label_->x(), 176 label_->SetBounds(label_->x(),
176 label_->y(), 177 label_->y(),
177 kDialogLabelPreferredWidth, 178 kDialogLabelPreferredWidth,
178 label_->GetHeightForWidth(kDialogLabelPreferredWidth)); 179 label_->GetHeightForWidth(kDialogLabelPreferredWidth));
179 } 180 }
180 181
181 } // namespace chromeos 182 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698