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

Unified Diff: chrome/browser/ui/gtk/focus_store_gtk.cc

Issue 8490029: GTK: Move code shared by future content/ classes and chrome/ to ui/. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Remove platform_util method. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/gtk/focus_store_gtk.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/focus_store_gtk.cc
diff --git a/chrome/browser/ui/gtk/focus_store_gtk.cc b/chrome/browser/ui/gtk/focus_store_gtk.cc
deleted file mode 100644
index 7eb904773637a450e44a155cc2616c61cdfc18c1..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/gtk/focus_store_gtk.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/gtk/focus_store_gtk.h"
-
-#include <gtk/gtk.h>
-
-#include "chrome/browser/platform_util.h"
-
-FocusStoreGtk::FocusStoreGtk()
- : widget_(NULL),
- destroy_handler_id_(0) {
-}
-
-FocusStoreGtk::~FocusStoreGtk() {
- DisconnectDestroyHandler();
-}
-
-void FocusStoreGtk::Store(GtkWidget* widget) {
- GtkWidget* focus_widget = NULL;
- if (widget) {
- GtkWindow* window = platform_util::GetTopLevel(widget);
- if (window)
- focus_widget = window->focus_widget;
- }
-
- SetWidget(focus_widget);
-}
-
-void FocusStoreGtk::SetWidget(GtkWidget* widget) {
- DisconnectDestroyHandler();
-
- // We don't add a ref. The signal handler below effectively gives us a weak
- // reference.
- widget_ = widget;
- if (widget_) {
- // When invoked, |gtk_widget_destroyed| will set |widget_| to NULL.
- destroy_handler_id_ = g_signal_connect(widget_, "destroy",
- G_CALLBACK(gtk_widget_destroyed),
- &widget_);
- }
-}
-
-void FocusStoreGtk::DisconnectDestroyHandler() {
- if (widget_) {
- g_signal_handler_disconnect(widget_, destroy_handler_id_);
- widget_ = NULL;
- }
-}
« no previous file with comments | « chrome/browser/ui/gtk/focus_store_gtk.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698