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 "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" | 5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" |
6 | 6 |
7 #include <X11/extensions/shape.h> | 7 #include <X11/extensions/shape.h> |
8 #include <X11/extensions/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
9 #include <X11/Xatom.h> | 9 #include <X11/Xatom.h> |
10 #include <X11/Xregion.h> | 10 #include <X11/Xregion.h> |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
361 | 361 |
362 aura::WindowTreeHost* DesktopWindowTreeHostX11::AsWindowTreeHost() { | 362 aura::WindowTreeHost* DesktopWindowTreeHostX11::AsWindowTreeHost() { |
363 return this; | 363 return this; |
364 } | 364 } |
365 | 365 |
366 void DesktopWindowTreeHostX11::ShowWindowWithState( | 366 void DesktopWindowTreeHostX11::ShowWindowWithState( |
367 ui::WindowShowState show_state) { | 367 ui::WindowShowState show_state) { |
368 if (!window_mapped_) | 368 if (!window_mapped_) |
369 MapWindow(show_state); | 369 MapWindow(show_state); |
370 | 370 |
371 if (show_state == ui::SHOW_STATE_NORMAL || | 371 switch (show_state) { |
372 show_state == ui::SHOW_STATE_MAXIMIZED) { | 372 case ui::SHOW_STATE_NORMAL: |
373 Activate(); | 373 Activate(); |
374 break; | |
375 case ui::SHOW_STATE_MAXIMIZED: | |
376 Maximize(); | |
377 break; | |
378 case ui::SHOW_STATE_MINIMIZED: | |
379 Minimize(); | |
380 break; | |
381 case ui::SHOW_STATE_FULLSCREEN: | |
382 SetFullscreen(TRUE); | |
Peter Kasting
2015/05/14 00:10:13
Shouldn't this be "true" instead of "TRUE"?
joone
2015/05/14 18:18:57
Yes, it should be true. I'll fix it.
| |
383 break; | |
384 default: | |
385 break; | |
374 } | 386 } |
375 | 387 |
376 native_widget_delegate_->AsWidget()->SetInitialFocus(show_state); | 388 native_widget_delegate_->AsWidget()->SetInitialFocus(show_state); |
377 } | 389 } |
378 | 390 |
379 void DesktopWindowTreeHostX11::ShowMaximizedWithBounds( | 391 void DesktopWindowTreeHostX11::ShowMaximizedWithBounds( |
380 const gfx::Rect& restored_bounds) { | 392 const gfx::Rect& restored_bounds) { |
381 ShowWindowWithState(ui::SHOW_STATE_MAXIMIZED); | 393 ShowWindowWithState(ui::SHOW_STATE_MAXIMIZED); |
382 // Enforce |restored_bounds_in_pixels_| since calling Maximize() could have | 394 // Enforce |restored_bounds_in_pixels_| since calling Maximize() could have |
383 // reset it. | 395 // reset it. |
(...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1987 if (linux_ui) { | 1999 if (linux_ui) { |
1988 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); | 2000 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); |
1989 if (native_theme) | 2001 if (native_theme) |
1990 return native_theme; | 2002 return native_theme; |
1991 } | 2003 } |
1992 | 2004 |
1993 return ui::NativeTheme::instance(); | 2005 return ui::NativeTheme::instance(); |
1994 } | 2006 } |
1995 | 2007 |
1996 } // namespace views | 2008 } // namespace views |
OLD | NEW |