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

Side by Side Diff: chrome/browser/tab_contents/tab_contents_view_gtk.cc

Issue 210013: Making BrowserFocusTest FocusTraversal faster (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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/tab_contents.cc ('k') | chrome/common/notification_type.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/tab_contents/tab_contents_view_gtk.h" 5 #include "chrome/browser/tab_contents/tab_contents_view_gtk.h"
6 6
7 #include <gdk/gdk.h> 7 #include <gdk/gdk.h>
8 #include <gdk/gdkkeysyms.h> 8 #include <gdk/gdkkeysyms.h>
9 #include <gtk/gtk.h> 9 #include <gtk/gtk.h>
10 10
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 } 549 }
550 550
551 void TabContentsViewGtk::GotFocus() { 551 void TabContentsViewGtk::GotFocus() {
552 // This is only used in the views FocusManager stuff but it bleeds through 552 // This is only used in the views FocusManager stuff but it bleeds through
553 // all subclasses. http://crbug.com/21875 553 // all subclasses. http://crbug.com/21875
554 } 554 }
555 555
556 // This is called when we the renderer asks us to take focus back (i.e., it has 556 // This is called when we the renderer asks us to take focus back (i.e., it has
557 // iterated past the last focusable element on the page). 557 // iterated past the last focusable element on the page).
558 void TabContentsViewGtk::TakeFocus(bool reverse) { 558 void TabContentsViewGtk::TakeFocus(bool reverse) {
559 gtk_widget_child_focus(GTK_WIDGET(GetTopLevelNativeWindow()), 559 if (!tab_contents()->delegate()->TakeFocus(reverse)) {
560 reverse ? GTK_DIR_TAB_BACKWARD : GTK_DIR_TAB_FORWARD); 560 gtk_widget_child_focus(GTK_WIDGET(GetTopLevelNativeWindow()),
561 reverse ? GTK_DIR_TAB_BACKWARD : GTK_DIR_TAB_FORWARD);
562 }
561 } 563 }
562 564
563 void TabContentsViewGtk::HandleKeyboardEvent( 565 void TabContentsViewGtk::HandleKeyboardEvent(
564 const NativeWebKeyboardEvent& event) { 566 const NativeWebKeyboardEvent& event) {
565 // This may be an accelerator. Try to pass it on to our browser window 567 // This may be an accelerator. Try to pass it on to our browser window
566 // to handle. 568 // to handle.
567 GtkWindow* window = GetTopLevelNativeWindow(); 569 GtkWindow* window = GetTopLevelNativeWindow();
568 if (!window) { 570 if (!window) {
569 NOTREACHED(); 571 NOTREACHED();
570 return; 572 return;
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 gtk_container_child_set_property(GTK_CONTAINER(floating_container), 698 gtk_container_child_set_property(GTK_CONTAINER(floating_container),
697 widget, "x", &value); 699 widget, "x", &value);
698 700
699 int child_y = std::max(half_view_height - (requisition.height / 2), 0); 701 int child_y = std::max(half_view_height - (requisition.height / 2), 0);
700 g_value_set_int(&value, child_y); 702 g_value_set_int(&value, child_y);
701 gtk_container_child_set_property(GTK_CONTAINER(floating_container), 703 gtk_container_child_set_property(GTK_CONTAINER(floating_container),
702 widget, "y", &value); 704 widget, "y", &value);
703 g_value_unset(&value); 705 g_value_unset(&value);
704 } 706 }
705 } 707 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/tab_contents.cc ('k') | chrome/common/notification_type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698