OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/ui/gtk/browser_window_gtk.h" | 5 #include "chrome/browser/ui/gtk/browser_window_gtk.h" |
6 | 6 |
7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
(...skipping 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1416 // call stack). In order to not reenter Close(), and to also follow the | 1416 // call stack). In order to not reenter Close(), and to also follow the |
1417 // expectations of BrowserList, we should run the BrowserWindowGtk destructor | 1417 // expectations of BrowserList, we should run the BrowserWindowGtk destructor |
1418 // not now, but after the run loop goes back to process messages. Otherwise | 1418 // not now, but after the run loop goes back to process messages. Otherwise |
1419 // we will remove ourself from BrowserList while it's being iterated. | 1419 // we will remove ourself from BrowserList while it's being iterated. |
1420 // Additionally, now that we know the window is gone, we need to make sure to | 1420 // Additionally, now that we know the window is gone, we need to make sure to |
1421 // set window_ to NULL, otherwise we will try to close the window again when | 1421 // set window_ to NULL, otherwise we will try to close the window again when |
1422 // we call Close() in the destructor. | 1422 // we call Close() in the destructor. |
1423 // | 1423 // |
1424 // We don't want to use DeleteSoon() here since it won't work on a nested pump | 1424 // We don't want to use DeleteSoon() here since it won't work on a nested pump |
1425 // (like in UI tests). | 1425 // (like in UI tests). |
1426 MessageLoop::current()->PostTask( | 1426 base::MessageLoop::current()->PostTask( |
1427 FROM_HERE, base::Bind(&base::DeletePointer<BrowserWindowGtk>, this)); | 1427 FROM_HERE, base::Bind(&base::DeletePointer<BrowserWindowGtk>, this)); |
1428 } | 1428 } |
1429 | 1429 |
1430 void BrowserWindowGtk::UnMaximize() { | 1430 void BrowserWindowGtk::UnMaximize() { |
1431 gtk_window_util::UnMaximize(window_, bounds_, restored_bounds_); | 1431 gtk_window_util::UnMaximize(window_, bounds_, restored_bounds_); |
1432 } | 1432 } |
1433 | 1433 |
1434 bool BrowserWindowGtk::CanClose() const { | 1434 bool BrowserWindowGtk::CanClose() const { |
1435 // You cannot close a frame for which there is an active originating drag | 1435 // You cannot close a frame for which there is an active originating drag |
1436 // session. | 1436 // session. |
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2403 wm_type == ui::WM_OPENBOX || | 2403 wm_type == ui::WM_OPENBOX || |
2404 wm_type == ui::WM_XFWM4); | 2404 wm_type == ui::WM_XFWM4); |
2405 } | 2405 } |
2406 | 2406 |
2407 // static | 2407 // static |
2408 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 2408 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
2409 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); | 2409 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); |
2410 browser_window_gtk->Init(); | 2410 browser_window_gtk->Init(); |
2411 return browser_window_gtk; | 2411 return browser_window_gtk; |
2412 } | 2412 } |
OLD | NEW |