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

Side by Side Diff: chrome/browser/views/tab_contents_container_view.cc

Issue 21298: Make accelerators work in interstitial pages (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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/tab_contents/interstitial_page.cc ('k') | 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <algorithm> 5 #include <algorithm>
6 6
7 #include "chrome/browser/views/tab_contents_container_view.h" 7 #include "chrome/browser/views/tab_contents_container_view.h"
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "chrome/browser/renderer_host/render_view_host.h" 10 #include "chrome/browser/renderer_host/render_view_host.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 bool TabContentsContainerView::GetAccessibleRole(VARIANT* role) { 171 bool TabContentsContainerView::GetAccessibleRole(VARIANT* role) {
172 DCHECK(role); 172 DCHECK(role);
173 173
174 role->vt = VT_I4; 174 role->vt = VT_I4;
175 role->lVal = ROLE_SYSTEM_GROUPING; 175 role->lVal = ROLE_SYSTEM_GROUPING;
176 return true; 176 return true;
177 } 177 }
178 178
179 bool TabContentsContainerView::ShouldLookupAccelerators( 179 bool TabContentsContainerView::ShouldLookupAccelerators(
180 const views::KeyEvent& e) { 180 const views::KeyEvent& e) {
181 // Don't look-up accelerators if we are showing a non-crashed WebContents.
182 // We'll first give the page a chance to process the key events. If it does
183 // not process them, they'll be returned to us and we'll treat them as
184 // accelerators then.
181 if (tab_contents_ && !tab_contents_->is_crashed() && 185 if (tab_contents_ && !tab_contents_->is_crashed() &&
182 tab_contents_->AsWebContents()) 186 tab_contents_->AsWebContents())
183 return false; 187 return false;
184 return true; 188 return true;
185 } 189 }
186 190
187 void TabContentsContainerView::Observe(NotificationType type, 191 void TabContentsContainerView::Observe(NotificationType type,
188 const NotificationSource& source, 192 const NotificationSource& source,
189 const NotificationDetails& details) { 193 const NotificationDetails& details) {
190 if (type == NotificationType::RENDER_VIEW_HOST_CHANGED) { 194 if (type == NotificationType::RENDER_VIEW_HOST_CHANGED) {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 Focus(); 252 Focus();
249 } 253 }
250 254
251 void TabContentsContainerView::TabContentsDestroyed(TabContents* contents) { 255 void TabContentsContainerView::TabContentsDestroyed(TabContents* contents) {
252 // Sometimes, a TabContents is destroyed before we know about it. This allows 256 // Sometimes, a TabContents is destroyed before we know about it. This allows
253 // us to clean up our state in case this happens. 257 // us to clean up our state in case this happens.
254 DCHECK(contents == tab_contents_); 258 DCHECK(contents == tab_contents_);
255 SetTabContents(NULL); 259 SetTabContents(NULL);
256 } 260 }
257 261
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/interstitial_page.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698