OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 1982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1993 | 1993 |
1994 void BrowserWindowGtk::SaveWindowPosition() { | 1994 void BrowserWindowGtk::SaveWindowPosition() { |
1995 // Browser::SaveWindowPlacement is used for session restore. | 1995 // Browser::SaveWindowPlacement is used for session restore. |
1996 ui::WindowShowState show_state = ui::SHOW_STATE_NORMAL; | 1996 ui::WindowShowState show_state = ui::SHOW_STATE_NORMAL; |
1997 if (IsMaximized()) | 1997 if (IsMaximized()) |
1998 show_state = ui::SHOW_STATE_MAXIMIZED; | 1998 show_state = ui::SHOW_STATE_MAXIMIZED; |
1999 else if (IsMinimized()) | 1999 else if (IsMinimized()) |
2000 show_state = ui::SHOW_STATE_MINIMIZED; | 2000 show_state = ui::SHOW_STATE_MINIMIZED; |
2001 | 2001 |
2002 if (chrome::ShouldSaveWindowPlacement(browser_.get())) | 2002 if (chrome::ShouldSaveWindowPlacement(browser_.get())) |
2003 chrome::SaveWindowPlacement(browser_.get(), restored_bounds_, show_state); | 2003 chrome::SaveWindowPlacement(browser_.get(), |
| 2004 restored_bounds_, |
| 2005 show_state, |
| 2006 false); |
2004 | 2007 |
2005 // We also need to save the placement for startup. | 2008 // We also need to save the placement for startup. |
2006 // This is a web of calls between views and delegates on Windows, but the | 2009 // This is a web of calls between views and delegates on Windows, but the |
2007 // crux of the logic follows. See also cocoa/browser_window_controller.mm. | 2010 // crux of the logic follows. See also cocoa/browser_window_controller.mm. |
2008 if (!browser_->profile()->GetPrefs()) | 2011 if (!browser_->profile()->GetPrefs()) |
2009 return; | 2012 return; |
2010 | 2013 |
2011 std::string window_name = chrome::GetWindowPlacementKey(browser_.get()); | 2014 std::string window_name = chrome::GetWindowPlacementKey(browser_.get()); |
2012 DictionaryPrefUpdate update(browser_->profile()->GetPrefs(), | 2015 DictionaryPrefUpdate update(browser_->profile()->GetPrefs(), |
2013 window_name.c_str()); | 2016 window_name.c_str()); |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2427 wm_type == ui::WM_OPENBOX || | 2430 wm_type == ui::WM_OPENBOX || |
2428 wm_type == ui::WM_XFWM4); | 2431 wm_type == ui::WM_XFWM4); |
2429 } | 2432 } |
2430 | 2433 |
2431 // static | 2434 // static |
2432 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 2435 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
2433 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); | 2436 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); |
2434 browser_window_gtk->Init(); | 2437 browser_window_gtk->Init(); |
2435 return browser_window_gtk; | 2438 return browser_window_gtk; |
2436 } | 2439 } |
OLD | NEW |