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

Side by Side Diff: chrome/browser/ui/views/web_dialog_view.cc

Issue 10446010: wip: Add ui::EventType parameter. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: wip - views_unittests Created 8 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 | « chrome/browser/ui/views/toolbar_view.cc ('k') | chrome/browser/ui/views/wrench_menu.cc » ('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 "chrome/browser/ui/views/web_dialog_view.h" 5 #include "chrome/browser/ui/views/web_dialog_view.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/property_bag.h" 9 #include "base/property_bag.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 WebDialogWebContentsDelegate(profile), 57 WebDialogWebContentsDelegate(profile),
58 initialized_(false), 58 initialized_(false),
59 delegate_(delegate), 59 delegate_(delegate),
60 dialog_controller_(new WebDialogController(this, profile, browser)), 60 dialog_controller_(new WebDialogController(this, profile, browser)),
61 web_view_(new views::WebView(profile)) { 61 web_view_(new views::WebView(profile)) {
62 web_view_->set_allow_accelerators(true); 62 web_view_->set_allow_accelerators(true);
63 AddChildView(web_view_); 63 AddChildView(web_view_);
64 set_contents_view(web_view_); 64 set_contents_view(web_view_);
65 SetLayoutManager(new views::FillLayout); 65 SetLayoutManager(new views::FillLayout);
66 // Pressing the ESC key will close the dialog. 66 // Pressing the ESC key will close the dialog.
67 AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE)); 67 AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE,
68 ui::EF_NONE,
69 ui::ET_KEY_PRESSED));
68 } 70 }
69 71
70 WebDialogView::~WebDialogView() { 72 WebDialogView::~WebDialogView() {
71 } 73 }
72 74
73 content::WebContents* WebDialogView::web_contents() { 75 content::WebContents* WebDialogView::web_contents() {
74 return web_view_->web_contents(); 76 return web_view_->web_contents();
75 } 77 }
76 78
77 //////////////////////////////////////////////////////////////////////////////// 79 ////////////////////////////////////////////////////////////////////////////////
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 329
328 if (delegate_) { 330 if (delegate_) {
329 gfx::Size out; 331 gfx::Size out;
330 delegate_->GetDialogSize(&out); 332 delegate_->GetDialogSize(&out);
331 if (!out.IsEmpty() && GetWidget()) 333 if (!out.IsEmpty() && GetWidget())
332 GetWidget()->CenterWindow(out); 334 GetWidget()->CenterWindow(out);
333 } 335 }
334 336
335 web_view_->LoadInitialURL(GetDialogContentURL()); 337 web_view_->LoadInitialURL(GetDialogContentURL());
336 } 338 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/toolbar_view.cc ('k') | chrome/browser/ui/views/wrench_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698