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

Side by Side Diff: chrome/browser/ui/ash/multi_user/multi_user_warning_dialog.cc

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT Created 6 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ui/ash/multi_user/multi_user_warning_dialog.h" 5 #include "chrome/browser/ui/ash/multi_user/multi_user_warning_dialog.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "grit/generated_resources.h" 8 #include "grit/generated_resources.h"
9 #include "ui/base/l10n/l10n_util.h" 9 #include "ui/base/l10n/l10n_util.h"
10 #include "ui/base/resource/resource_bundle.h" 10 #include "ui/base/resource/resource_bundle.h"
(...skipping 25 matching lines...) Expand all
36 36
37 static void ShowDialog(const base::Callback<void(bool)> on_accept); 37 static void ShowDialog(const base::Callback<void(bool)> on_accept);
38 38
39 // views::DialogDelegate overrides. 39 // views::DialogDelegate overrides.
40 virtual bool Accept() OVERRIDE; 40 virtual bool Accept() OVERRIDE;
41 41
42 // views::WidgetDelegate overrides. 42 // views::WidgetDelegate overrides.
43 virtual ui::ModalType GetModalType() const OVERRIDE; 43 virtual ui::ModalType GetModalType() const OVERRIDE;
44 44
45 // views::View overrides. 45 // views::View overrides.
46 virtual gfx::Size GetPreferredSize() OVERRIDE; 46 virtual gfx::Size GetPreferredSize() const OVERRIDE;
47 47
48 private: 48 private:
49 void InitDialog(); 49 void InitDialog();
50 50
51 scoped_ptr<views::Checkbox> no_show_checkbox_; 51 scoped_ptr<views::Checkbox> no_show_checkbox_;
52 const base::Callback<void(bool)> on_accept_; 52 const base::Callback<void(bool)> on_accept_;
53 53
54 DISALLOW_COPY_AND_ASSIGN(TeleportWarningView); 54 DISALLOW_COPY_AND_ASSIGN(TeleportWarningView);
55 }; 55 };
56 56
(...skipping 23 matching lines...) Expand all
80 80
81 bool TeleportWarningView::Accept() { 81 bool TeleportWarningView::Accept() {
82 on_accept_.Run(no_show_checkbox_->checked()); 82 on_accept_.Run(no_show_checkbox_->checked());
83 return true; 83 return true;
84 } 84 }
85 85
86 ui::ModalType TeleportWarningView::GetModalType() const { 86 ui::ModalType TeleportWarningView::GetModalType() const {
87 return ui::MODAL_TYPE_SYSTEM; 87 return ui::MODAL_TYPE_SYSTEM;
88 } 88 }
89 89
90 gfx::Size TeleportWarningView::GetPreferredSize() { 90 gfx::Size TeleportWarningView::GetPreferredSize() const {
91 return gfx::Size(kDefaultWidth, kDefaultHeight); 91 return gfx::Size(kDefaultWidth, kDefaultHeight);
92 } 92 }
93 93
94 void TeleportWarningView::InitDialog() { 94 void TeleportWarningView::InitDialog() {
95 const gfx::Insets kDialogInsets(kTopInset, kInset, kInset, kInset); 95 const gfx::Insets kDialogInsets(kTopInset, kInset, kInset, kInset);
96 96
97 // Create the views and layout manager and set them up. 97 // Create the views and layout manager and set them up.
98 views::GridLayout* grid_layout = views::GridLayout::CreatePanel(this); 98 views::GridLayout* grid_layout = views::GridLayout::CreatePanel(this);
99 grid_layout->SetInsets(kDialogInsets); 99 grid_layout->SetInsets(kDialogInsets);
100 100
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 154
155 //////////////////////////////////////////////////////////////////////////////// 155 ////////////////////////////////////////////////////////////////////////////////
156 // Factory function. 156 // Factory function.
157 157
158 void ShowMultiprofilesWarningDialog( 158 void ShowMultiprofilesWarningDialog(
159 const base::Callback<void(bool)> on_accept) { 159 const base::Callback<void(bool)> on_accept) {
160 TeleportWarningView::ShowDialog(on_accept); 160 TeleportWarningView::ShowDialog(on_accept);
161 } 161 }
162 162
163 } // namespace chromeos 163 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_view_host.h ('k') | chrome/browser/ui/extensions/extension_installed_bubble.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698