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

Side by Side Diff: chrome/browser/ui/views/extensions/extension_view.cc

Issue 7694002: Make sure Backspace in a text field in an infobar does not navigate back one page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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 | « no previous file | no next file » | 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) 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/extensions/extension_view.h" 5 #include "chrome/browser/ui/views/extensions/extension_view.h"
6 6
7 #include "chrome/browser/extensions/extension_host.h" 7 #include "chrome/browser/extensions/extension_host.h"
8 #include "chrome/browser/ui/views/extensions/extension_popup.h" 8 #include "chrome/browser/ui/views/extensions/extension_popup.h"
9 #include "content/browser/renderer_host/render_view_host.h" 9 #include "content/browser/renderer_host/render_view_host.h"
10 #include "content/browser/renderer_host/render_widget_host_view.h" 10 #include "content/browser/renderer_host/render_widget_host_view.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 } 165 }
166 166
167 void ExtensionView::PreferredSizeChanged() { 167 void ExtensionView::PreferredSizeChanged() {
168 View::PreferredSizeChanged(); 168 View::PreferredSizeChanged();
169 if (container_) 169 if (container_)
170 container_->OnExtensionPreferredSizeChanged(this); 170 container_->OnExtensionPreferredSizeChanged(this);
171 } 171 }
172 172
173 bool ExtensionView::SkipDefaultKeyEventProcessing(const views::KeyEvent& e) { 173 bool ExtensionView::SkipDefaultKeyEventProcessing(const views::KeyEvent& e) {
174 // Let the tab key event be processed by the renderer (instead of moving the 174 // Let the tab key event be processed by the renderer (instead of moving the
175 // focus to the next focusable view). 175 // focus to the next focusable view). Also handle Backspace, since otherwise
176 return (e.key_code() == ui::VKEY_TAB); 176 // (on Windows at least), pressing Backspace, when focus is on a text field
177 // within the ExtensionView, will navigate the page back instead of erasing a
178 // character.
179 return (e.key_code() == ui::VKEY_TAB || e.key_code() == ui::VKEY_BACK);
177 } 180 }
178 181
179 void ExtensionView::OnBoundsChanged(const gfx::Rect& previous_bounds) { 182 void ExtensionView::OnBoundsChanged(const gfx::Rect& previous_bounds) {
180 // Propagate the new size to RenderWidgetHostView. 183 // Propagate the new size to RenderWidgetHostView.
181 // We can't send size zero because RenderWidget DCHECKs that. 184 // We can't send size zero because RenderWidget DCHECKs that.
182 if (render_view_host()->view() && !bounds().IsEmpty()) 185 if (render_view_host()->view() && !bounds().IsEmpty())
183 render_view_host()->view()->SetSize(size()); 186 render_view_host()->view()->SetSize(size());
184 } 187 }
185 188
186 void ExtensionView::HandleMouseMove() { 189 void ExtensionView::HandleMouseMove() {
(...skipping 11 matching lines...) Expand all
198 render_view_host()->view()->SetBackground(pending_background_); 201 render_view_host()->view()->SetBackground(pending_background_);
199 pending_background_.reset(); 202 pending_background_.reset();
200 } 203 }
201 204
202 // Tell the renderer not to draw scroll bars in popups unless the 205 // Tell the renderer not to draw scroll bars in popups unless the
203 // popups are at the maximum allowed size. 206 // popups are at the maximum allowed size.
204 gfx::Size largest_popup_size(ExtensionPopup::kMaxWidth, 207 gfx::Size largest_popup_size(ExtensionPopup::kMaxWidth,
205 ExtensionPopup::kMaxHeight); 208 ExtensionPopup::kMaxHeight);
206 host_->DisableScrollbarsForSmallWindows(largest_popup_size); 209 host_->DisableScrollbarsForSmallWindows(largest_popup_size);
207 } 210 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698