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

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

Issue 8508055: Move views::Accelerator to ui in order to use it from aura code. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 9 years, 1 month 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/html_dialog_view.h" 5 #include "chrome/browser/ui/views/html_dialog_view.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 //////////////////////////////////////////////////////////////////////////////// 62 ////////////////////////////////////////////////////////////////////////////////
63 // HtmlDialogView, views::View implementation: 63 // HtmlDialogView, views::View implementation:
64 64
65 gfx::Size HtmlDialogView::GetPreferredSize() { 65 gfx::Size HtmlDialogView::GetPreferredSize() {
66 gfx::Size out; 66 gfx::Size out;
67 if (delegate_) 67 if (delegate_)
68 delegate_->GetDialogSize(&out); 68 delegate_->GetDialogSize(&out);
69 return out; 69 return out;
70 } 70 }
71 71
72 bool HtmlDialogView::AcceleratorPressed(const views::Accelerator& accelerator) { 72 bool HtmlDialogView::AcceleratorPressed(const ui::Accelerator& accelerator) {
73 // Pressing ESC closes the dialog. 73 // Pressing ESC closes the dialog.
74 DCHECK_EQ(ui::VKEY_ESCAPE, accelerator.key_code()); 74 DCHECK_EQ(ui::VKEY_ESCAPE, accelerator.key_code());
75 OnDialogClosed(std::string()); 75 OnDialogClosed(std::string());
76 return true; 76 return true;
77 } 77 }
78 78
79 void HtmlDialogView::ViewHierarchyChanged( 79 void HtmlDialogView::ViewHierarchyChanged(
80 bool is_add, View* parent, View* child) { 80 bool is_add, View* parent, View* child) {
81 DOMView::ViewHierarchyChanged(is_add, parent, child); 81 DOMView::ViewHierarchyChanged(is_add, parent, child);
82 if (is_add && GetWidget() && !initialized_) { 82 if (is_add && GetWidget() && !initialized_) {
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 // the comment above HtmlDialogUI in its header file for why. 250 // the comment above HtmlDialogUI in its header file for why.
251 HtmlDialogUI::GetPropertyAccessor().SetProperty( 251 HtmlDialogUI::GetPropertyAccessor().SetProperty(
252 tab_contents->property_bag(), this); 252 tab_contents->property_bag(), this);
253 tab_watcher_.reset(new TabFirstRenderWatcher(tab_contents, this)); 253 tab_watcher_.reset(new TabFirstRenderWatcher(tab_contents, this));
254 254
255 DOMView::LoadURL(GetDialogContentURL()); 255 DOMView::LoadURL(GetDialogContentURL());
256 } 256 }
257 257
258 void HtmlDialogView::RegisterDialogAccelerators() { 258 void HtmlDialogView::RegisterDialogAccelerators() {
259 // Pressing the ESC key will close the dialog. 259 // Pressing the ESC key will close the dialog.
260 AddAccelerator(views::Accelerator(ui::VKEY_ESCAPE, false, false, false)); 260 AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, false, false, false));
261 } 261 }
262 262
263 void HtmlDialogView::OnRenderHostCreated(RenderViewHost* host) { 263 void HtmlDialogView::OnRenderHostCreated(RenderViewHost* host) {
264 } 264 }
265 265
266 void HtmlDialogView::OnTabMainFrameLoaded() { 266 void HtmlDialogView::OnTabMainFrameLoaded() {
267 } 267 }
268 268
269 void HtmlDialogView::OnTabMainFrameFirstRender() { 269 void HtmlDialogView::OnTabMainFrameFirstRender() {
270 #if defined(OS_CHROMEOS) && defined(TOOLKIT_USES_GTK) 270 #if defined(OS_CHROMEOS) && defined(TOOLKIT_USES_GTK)
271 if (initialized_) { 271 if (initialized_) {
272 views::NativeWidgetGtk::UpdateFreezeUpdatesProperty( 272 views::NativeWidgetGtk::UpdateFreezeUpdatesProperty(
273 GTK_WINDOW(GetWidget()->GetNativeView()), false); 273 GTK_WINDOW(GetWidget()->GetNativeView()), false);
274 } 274 }
275 #endif 275 #endif
276 } 276 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/html_dialog_view.h ('k') | chrome/browser/ui/views/js_modal_dialog_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698