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

Side by Side Diff: chrome/browser/gtk/focus_store_gtk.h

Issue 3235010: reland r57885 with a fix for linux/views. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: . Created 10 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
« no previous file with comments | « chrome/browser/gtk/constrained_window_gtk.cc ('k') | chrome/browser/gtk/focus_store_gtk.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_GTK_FOCUS_STORE_GTK_H_ 5 #ifndef CHROME_BROWSER_GTK_FOCUS_STORE_GTK_H_
6 #define CHROME_BROWSER_GTK_FOCUS_STORE_GTK_H_ 6 #define CHROME_BROWSER_GTK_FOCUS_STORE_GTK_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 10
11 typedef struct _GtkWidget GtkWidget; 11 typedef struct _GtkWidget GtkWidget;
12 12
13 class FocusStoreGtk { 13 class FocusStoreGtk {
14 public: 14 public:
15 FocusStoreGtk(); 15 FocusStoreGtk();
16 16
17 virtual ~FocusStoreGtk(); 17 virtual ~FocusStoreGtk();
18 18
19 GtkWidget* widget() const { return widget_; } 19 GtkWidget* widget() const { return widget_; }
20 20
21 // Save the widget that is currently focused for |widget|'s toplevel (NOT 21 // Save the widget that is currently focused for |widget|'s toplevel (NOT
22 // |widget|). Call with NULL to clear |widget_|. 22 // |widget|).
23 void Store(GtkWidget* widget); 23 void Store(GtkWidget* widget);
24 24
25 // Save |widget| as the focus widget. Call with NULL to clear |widget_|.
26 void SetWidget(GtkWidget* widget);
27
25 private: 28 private:
26 // Disconnect the previous destroy handler (if any). 29 // Disconnect the previous destroy handler (if any).
27 void DisconnectDestroyHandler(); 30 void DisconnectDestroyHandler();
28 31
29 // The widget which last had focus. 32 // The widget which last had focus.
30 GtkWidget* widget_; 33 GtkWidget* widget_;
31 34
32 // The widget for which we've stored focus might be destroyed by the time we 35 // The widget for which we've stored focus might be destroyed by the time we
33 // want to restore focus. Thus we connect to the "destroy" signal on that 36 // want to restore focus. Thus we connect to the "destroy" signal on that
34 // widget. This is the ID for the destroy handler. 37 // widget. This is the ID for the destroy handler.
35 unsigned int destroy_handler_id_; 38 unsigned int destroy_handler_id_;
36 39
37 DISALLOW_COPY_AND_ASSIGN(FocusStoreGtk); 40 DISALLOW_COPY_AND_ASSIGN(FocusStoreGtk);
38 }; 41 };
39 42
40 #endif // CHROME_BROWSER_GTK_FOCUS_STORE_GTK_H_ 43 #endif // CHROME_BROWSER_GTK_FOCUS_STORE_GTK_H_
OLDNEW
« no previous file with comments | « chrome/browser/gtk/constrained_window_gtk.cc ('k') | chrome/browser/gtk/focus_store_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698