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

Side by Side Diff: chrome/browser/ui/views/constrained_web_dialog_delegate_views.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/webui/constrained_web_dialog_delegate_base.h" 5 #include "chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "components/web_modal/web_contents_modal_dialog_host.h" 8 #include "components/web_modal/web_contents_modal_dialog_host.h"
9 #include "components/web_modal/web_contents_modal_dialog_manager.h" 9 #include "components/web_modal/web_contents_modal_dialog_manager.h"
10 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" 10 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 } 146 }
147 147
148 // views::WebView overrides. 148 // views::WebView overrides.
149 virtual bool AcceleratorPressed( 149 virtual bool AcceleratorPressed(
150 const ui::Accelerator& accelerator) OVERRIDE { 150 const ui::Accelerator& accelerator) OVERRIDE {
151 // Pressing ESC closes the dialog. 151 // Pressing ESC closes the dialog.
152 DCHECK_EQ(ui::VKEY_ESCAPE, accelerator.key_code()); 152 DCHECK_EQ(ui::VKEY_ESCAPE, accelerator.key_code());
153 impl_->window()->Close(); 153 impl_->window()->Close();
154 return true; 154 return true;
155 } 155 }
156 virtual gfx::Size GetPreferredSize() OVERRIDE { 156 virtual gfx::Size GetPreferredSize() const OVERRIDE {
157 gfx::Size size; 157 gfx::Size size;
158 if (!impl_->closed_via_webui()) 158 if (!impl_->closed_via_webui())
159 GetWebDialogDelegate()->GetDialogSize(&size); 159 GetWebDialogDelegate()->GetDialogSize(&size);
160 return size; 160 return size;
161 } 161 }
162 virtual gfx::Size GetMinimumSize() OVERRIDE { 162 virtual gfx::Size GetMinimumSize() const OVERRIDE {
163 // Return an empty size so that we can be made smaller. 163 // Return an empty size so that we can be made smaller.
164 return gfx::Size(); 164 return gfx::Size();
165 } 165 }
166 166
167 void SetWindow(views::Widget* window) { 167 void SetWindow(views::Widget* window) {
168 impl_->set_window(window); 168 impl_->set_window(window);
169 } 169 }
170 170
171 views::Widget* GetWindow() { 171 views::Widget* GetWindow() {
172 return impl_->window(); 172 return impl_->window();
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 web_contents_modal_dialog_manager->delegate(); 211 web_contents_modal_dialog_manager->delegate();
212 DCHECK(modal_delegate); 212 DCHECK(modal_delegate);
213 views::Widget* window = views::Widget::CreateWindowAsFramelessChild( 213 views::Widget* window = views::Widget::CreateWindowAsFramelessChild(
214 constrained_delegate, 214 constrained_delegate,
215 modal_delegate->GetWebContentsModalDialogHost()->GetHostView()); 215 modal_delegate->GetWebContentsModalDialogHost()->GetHostView());
216 web_contents_modal_dialog_manager->ShowModalDialog( 216 web_contents_modal_dialog_manager->ShowModalDialog(
217 window->GetNativeView()); 217 window->GetNativeView());
218 constrained_delegate->SetWindow(window); 218 constrained_delegate->SetWindow(window);
219 return constrained_delegate; 219 return constrained_delegate;
220 } 220 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/collected_cookies_views.cc ('k') | chrome/browser/ui/views/constrained_window_views_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698