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

Side by Side Diff: chrome/browser/ui/gtk/browser_window_gtk.cc

Issue 8586045: Add extension API to change window show state using chrome.windows.update(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make test non-linux, generated crx docs 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <dlfcn.h> 9 #include <dlfcn.h>
10 #include <string> 10 #include <string>
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 } 838 }
839 839
840 bool BrowserWindowGtk::IsMaximized() const { 840 bool BrowserWindowGtk::IsMaximized() const {
841 return (state_ & GDK_WINDOW_STATE_MAXIMIZED); 841 return (state_ & GDK_WINDOW_STATE_MAXIMIZED);
842 } 842 }
843 843
844 bool BrowserWindowGtk::IsMinimized() const { 844 bool BrowserWindowGtk::IsMinimized() const {
845 return (state_ & GDK_WINDOW_STATE_ICONIFIED); 845 return (state_ & GDK_WINDOW_STATE_ICONIFIED);
846 } 846 }
847 847
848 void BrowserWindowGtk::Maximize() {
849 gtk_window_maximize(window_);
850 }
851
852 void BrowserWindowGtk::Minimize() {
853 gtk_window_iconify(window_);
854 }
855
856 void BrowserWindowGtk::Restore() {
857 if (IsMaximized())
858 UnMaximize();
859 else if (IsMinimized())
860 gtk_window_deiconify(window_);
861 }
862
848 bool BrowserWindowGtk::ShouldDrawContentDropShadow() { 863 bool BrowserWindowGtk::ShouldDrawContentDropShadow() {
849 return !IsMaximized() && UseCustomFrame(); 864 return !IsMaximized() && UseCustomFrame();
850 } 865 }
851 866
852 void BrowserWindowGtk::EnterFullscreen( 867 void BrowserWindowGtk::EnterFullscreen(
853 const GURL& url, FullscreenExitBubbleType type) { 868 const GURL& url, FullscreenExitBubbleType type) {
854 // gtk_window_(un)fullscreen asks the window manager to toggle the EWMH 869 // gtk_window_(un)fullscreen asks the window manager to toggle the EWMH
855 // for fullscreen windows. Not all window managers support this. 870 // for fullscreen windows. Not all window managers support this.
856 gtk_window_fullscreen(window_); 871 gtk_window_fullscreen(window_);
857 bool is_kiosk = 872 bool is_kiosk =
(...skipping 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after
2406 wm_type == ui::WM_OPENBOX || 2421 wm_type == ui::WM_OPENBOX ||
2407 wm_type == ui::WM_XFWM4); 2422 wm_type == ui::WM_XFWM4);
2408 } 2423 }
2409 2424
2410 // static 2425 // static
2411 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { 2426 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) {
2412 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); 2427 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser);
2413 browser_window_gtk->Init(); 2428 browser_window_gtk->Init();
2414 return browser_window_gtk; 2429 return browser_window_gtk;
2415 } 2430 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698