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

Side by Side Diff: chrome/browser/ui/gtk/extensions/native_app_window_gtk.cc

Issue 14031021: Save and restore State for ShellWindows, including panels (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 7 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
OLDNEW
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/extensions/native_app_window_gtk.h" 5 #include "chrome/browser/ui/gtk/extensions/native_app_window_gtk.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/gtk/extensions/extension_keybinding_registry_gtk.h" 9 #include "chrome/browser/ui/gtk/extensions/extension_keybinding_registry_gtk.h"
10 #include "chrome/browser/ui/gtk/gtk_util.h" 10 #include "chrome/browser/ui/gtk/gtk_util.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 gfx::NativeWindow NativeAppWindowGtk::GetNativeWindow() { 163 gfx::NativeWindow NativeAppWindowGtk::GetNativeWindow() {
164 return window_; 164 return window_;
165 } 165 }
166 166
167 gfx::Rect NativeAppWindowGtk::GetRestoredBounds() const { 167 gfx::Rect NativeAppWindowGtk::GetRestoredBounds() const {
168 gfx::Rect window_bounds = restored_bounds_; 168 gfx::Rect window_bounds = restored_bounds_;
169 window_bounds.Inset(-GetFrameInsets()); 169 window_bounds.Inset(-GetFrameInsets());
170 return window_bounds; 170 return window_bounds;
171 } 171 }
172 172
173 ui::WindowShowState NativeAppWindowGtk::GetRestoredState() const {
174 if (IsMaximized())
175 return ui::SHOW_STATE_MAXIMIZED;
176 return ui::SHOW_STATE_NORMAL;
177 }
178
173 gfx::Rect NativeAppWindowGtk::GetBounds() const { 179 gfx::Rect NativeAppWindowGtk::GetBounds() const {
174 gfx::Rect window_bounds = bounds_; 180 gfx::Rect window_bounds = bounds_;
175 window_bounds.Inset(-GetFrameInsets()); 181 window_bounds.Inset(-GetFrameInsets());
176 return window_bounds; 182 return window_bounds;
177 } 183 }
178 184
179 void NativeAppWindowGtk::Show() { 185 void NativeAppWindowGtk::Show() {
180 gtk_window_present(window_); 186 gtk_window_present(window_);
181 } 187 }
182 188
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 if (fullscreen) 484 if (fullscreen)
479 gtk_window_fullscreen(window_); 485 gtk_window_fullscreen(window_);
480 else 486 else
481 gtk_window_unfullscreen(window_); 487 gtk_window_unfullscreen(window_);
482 } 488 }
483 489
484 bool NativeAppWindowGtk::IsFullscreenOrPending() const { 490 bool NativeAppWindowGtk::IsFullscreenOrPending() const {
485 return content_thinks_its_fullscreen_; 491 return content_thinks_its_fullscreen_;
486 } 492 }
487 493
494 bool NativeAppWindowGtk::IsDetached() const {
495 return false;
496 }
497
488 void NativeAppWindowGtk::UpdateWindowIcon() { 498 void NativeAppWindowGtk::UpdateWindowIcon() {
489 Profile* profile = shell_window_->profile(); 499 Profile* profile = shell_window_->profile();
490 gfx::Image app_icon = shell_window_->app_icon(); 500 gfx::Image app_icon = shell_window_->app_icon();
491 if (!app_icon.IsEmpty()) 501 if (!app_icon.IsEmpty())
492 gtk_util::SetWindowIcon(window_, profile, app_icon.ToGdkPixbuf()); 502 gtk_util::SetWindowIcon(window_, profile, app_icon.ToGdkPixbuf());
493 else 503 else
494 gtk_util::SetWindowIcon(window_, profile); 504 gtk_util::SetWindowIcon(window_, profile);
495 } 505 }
496 506
497 void NativeAppWindowGtk::UpdateWindowTitle() { 507 void NativeAppWindowGtk::UpdateWindowTitle() {
(...skipping 14 matching lines...) Expand all
512 522
513 draggable_region_.reset(ShellWindow::RawDraggableRegionsToSkRegion(regions)); 523 draggable_region_.reset(ShellWindow::RawDraggableRegionsToSkRegion(regions));
514 } 524 }
515 525
516 // static 526 // static
517 NativeAppWindow* NativeAppWindow::Create( 527 NativeAppWindow* NativeAppWindow::Create(
518 ShellWindow* shell_window, 528 ShellWindow* shell_window,
519 const ShellWindow::CreateParams& params) { 529 const ShellWindow::CreateParams& params) {
520 return new NativeAppWindowGtk(shell_window, params); 530 return new NativeAppWindowGtk(shell_window, params);
521 } 531 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/extensions/native_app_window_gtk.h ('k') | chrome/browser/ui/panels/panel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698