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

Side by Side Diff: views/window/window_gtk.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/window/window.cc ('k') | views/window/window_win.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) 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 "views/window/window_gtk.h" 5 #include "views/window/window_gtk.h"
6 6
7 #include "app/gfx/path.h" 7 #include "app/gfx/path.h"
8 #include "app/l10n_util.h" 8 #include "app/l10n_util.h"
9 #include "base/gfx/rect.h" 9 #include "base/gfx/rect.h"
10 #include "views/screen.h" 10 #include "views/screen.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 const gfx::Rect& bounds, 83 const gfx::Rect& bounds,
84 WindowDelegate* window_delegate) { 84 WindowDelegate* window_delegate) {
85 WindowGtk* window = new WindowGtk(window_delegate); 85 WindowGtk* window = new WindowGtk(window_delegate);
86 window->GetNonClientView()->SetFrameView(window->CreateFrameViewForWindow()); 86 window->GetNonClientView()->SetFrameView(window->CreateFrameViewForWindow());
87 window->Init(parent, bounds); 87 window->Init(parent, bounds);
88 return window; 88 return window;
89 } 89 }
90 90
91 // static 91 // static
92 void Window::CloseAllSecondaryWindows() { 92 void Window::CloseAllSecondaryWindows() {
93 NOTIMPLEMENTED(); 93 for (GList* window = gtk_window_list_toplevels(); window;
94 window = g_list_next(window)) {
95 Window::CloseSecondaryWidget(
96 WidgetGtk::GetViewForNative(GTK_WIDGET(window->data)));
97 }
94 } 98 }
95 99
96 gfx::Rect WindowGtk::GetBounds() const { 100 gfx::Rect WindowGtk::GetBounds() const {
97 gfx::Rect bounds; 101 gfx::Rect bounds;
98 WidgetGtk::GetBounds(&bounds, true); 102 WidgetGtk::GetBounds(&bounds, true);
99 return bounds; 103 return bounds;
100 } 104 }
101 105
102 gfx::Rect WindowGtk::GetNormalBounds() const { 106 gfx::Rect WindowGtk::GetNormalBounds() const {
103 NOTIMPLEMENTED(); 107 NOTIMPLEMENTED();
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 center_rect = Screen::GetMonitorWorkAreaNearestWindow(GetNativeWindow()); 440 center_rect = Screen::GetMonitorWorkAreaNearestWindow(GetNativeWindow());
437 } 441 }
438 gfx::Size size = non_client_view_->GetPreferredSize(); 442 gfx::Size size = non_client_view_->GetPreferredSize();
439 gfx::Rect bounds(center_rect.x() + (center_rect.width() - size.width()) / 2, 443 gfx::Rect bounds(center_rect.x() + (center_rect.width() - size.width()) / 2,
440 center_rect.y() + (center_rect.height() - size.height()) / 2, 444 center_rect.y() + (center_rect.height() - size.height()) / 2,
441 size.width(), size.height()); 445 size.width(), size.height());
442 SetBounds(bounds, NULL); 446 SetBounds(bounds, NULL);
443 } 447 }
444 448
445 } // namespace views 449 } // namespace views
OLDNEW
« no previous file with comments | « views/window/window.cc ('k') | views/window/window_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698