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

Side by Side Diff: ui/views/controls/webview/web_dialog_view.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
« no previous file with comments | « ui/views/controls/webview/web_dialog_view.h ('k') | ui/views/controls/webview/webview.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/views/controls/webview/web_dialog_view.h" 5 #include "ui/views/controls/webview/web_dialog_view.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "content/public/browser/browser_context.h" 10 #include "content/public/browser/browser_context.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 WebDialogView::~WebDialogView() { 59 WebDialogView::~WebDialogView() {
60 } 60 }
61 61
62 content::WebContents* WebDialogView::web_contents() { 62 content::WebContents* WebDialogView::web_contents() {
63 return web_view_->web_contents(); 63 return web_view_->web_contents();
64 } 64 }
65 65
66 //////////////////////////////////////////////////////////////////////////////// 66 ////////////////////////////////////////////////////////////////////////////////
67 // WebDialogView, views::View implementation: 67 // WebDialogView, views::View implementation:
68 68
69 gfx::Size WebDialogView::GetPreferredSize() { 69 gfx::Size WebDialogView::GetPreferredSize() const {
70 gfx::Size out; 70 gfx::Size out;
71 if (delegate_) 71 if (delegate_)
72 delegate_->GetDialogSize(&out); 72 delegate_->GetDialogSize(&out);
73 return out; 73 return out;
74 } 74 }
75 75
76 gfx::Size WebDialogView::GetMinimumSize() { 76 gfx::Size WebDialogView::GetMinimumSize() const {
77 gfx::Size out; 77 gfx::Size out;
78 if (delegate_) 78 if (delegate_)
79 delegate_->GetMinimumDialogSize(&out); 79 delegate_->GetMinimumDialogSize(&out);
80 return out; 80 return out;
81 } 81 }
82 82
83 bool WebDialogView::AcceleratorPressed(const ui::Accelerator& accelerator) { 83 bool WebDialogView::AcceleratorPressed(const ui::Accelerator& accelerator) {
84 // Pressing ESC closes the dialog. 84 // Pressing ESC closes the dialog.
85 DCHECK_EQ(ui::VKEY_ESCAPE, accelerator.key_code()); 85 DCHECK_EQ(ui::VKEY_ESCAPE, accelerator.key_code());
86 if (GetWidget()) 86 if (GetWidget())
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 web_contents->SetDelegate(this); 348 web_contents->SetDelegate(this);
349 349
350 // Set the delegate. This must be done before loading the page. See 350 // Set the delegate. This must be done before loading the page. See
351 // the comment above WebDialogUI in its header file for why. 351 // the comment above WebDialogUI in its header file for why.
352 WebDialogUI::SetDelegate(web_contents, this); 352 WebDialogUI::SetDelegate(web_contents, this);
353 353
354 web_view_->LoadInitialURL(GetDialogContentURL()); 354 web_view_->LoadInitialURL(GetDialogContentURL());
355 } 355 }
356 356
357 } // namespace views 357 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/webview/web_dialog_view.h ('k') | ui/views/controls/webview/webview.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698