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

Unified Diff: views/window/window.cc

Issue 197063: Implements WindowGtk::CloseAllSecondaryWindows. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/window/window.h ('k') | views/window/window_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/window/window.cc
===================================================================
--- views/window/window.cc (revision 25660)
+++ views/window/window.cc (working copy)
@@ -9,6 +9,7 @@
#include "app/resource_bundle.h"
#include "base/gfx/size.h"
#include "base/string_util.h"
+#include "views/widget/widget.h"
namespace views {
@@ -41,4 +42,21 @@
GetLocalizedContentsHeight(row_resource_id));
}
+// static
+void Window::CloseSecondaryWidget(Widget* widget) {
+ if (!widget)
+ return;
+
+ // Close widget if it's identified as a secondary window.
+ Window* window = widget->GetWindow();
+ if (window) {
+ if (!window->IsAppWindow())
+ window->Close();
+ } else {
+ // If it's not a Window, then close it anyway since it probably is
+ // secondary.
+ widget->Close();
+ }
+}
+
} // namespace views
« no previous file with comments | « views/window/window.h ('k') | views/window/window_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698