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

Side by Side Diff: extensions/browser/app_window/app_window.cc

Issue 1947993002: Do not save the position after the window is hidden Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/app_window/app_window.h" 5 #include "extensions/browser/app_window/app_window.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 #include "third_party/skia/include/core/SkRegion.h" 54 #include "third_party/skia/include/core/SkRegion.h"
55 #include "ui/base/resource/resource_bundle.h" 55 #include "ui/base/resource/resource_bundle.h"
56 #include "ui/display/screen.h" 56 #include "ui/display/screen.h"
57 #include "ui/events/keycodes/keyboard_codes.h" 57 #include "ui/events/keycodes/keyboard_codes.h"
58 58
59 #if !defined(OS_MACOSX) 59 #if !defined(OS_MACOSX)
60 #include "components/prefs/pref_service.h" 60 #include "components/prefs/pref_service.h"
61 #include "extensions/browser/pref_names.h" 61 #include "extensions/browser/pref_names.h"
62 #endif 62 #endif
63 63
64 #include "ui/aura/window.h"
65
64 using content::BrowserContext; 66 using content::BrowserContext;
65 using content::ConsoleMessageLevel; 67 using content::ConsoleMessageLevel;
66 using content::WebContents; 68 using content::WebContents;
67 using web_modal::WebContentsModalDialogHost; 69 using web_modal::WebContentsModalDialogHost;
68 using web_modal::WebContentsModalDialogManager; 70 using web_modal::WebContentsModalDialogManager;
69 71
70 namespace extensions { 72 namespace extensions {
71 73
72 namespace { 74 namespace {
73 75
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 if (native_app_window_->IsFullscreen()) { 499 if (native_app_window_->IsFullscreen()) {
498 if (!IsFullscreen()) 500 if (!IsFullscreen())
499 fullscreen_types_ = FULLSCREEN_TYPE_OS; 501 fullscreen_types_ = FULLSCREEN_TYPE_OS;
500 } else { 502 } else {
501 fullscreen_types_ = FULLSCREEN_TYPE_NONE; 503 fullscreen_types_ = FULLSCREEN_TYPE_NONE;
502 } 504 }
503 505
504 RestoreAlwaysOnTop(); // Same as in SetNativeWindowFullscreen. 506 RestoreAlwaysOnTop(); // Same as in SetNativeWindowFullscreen.
505 #endif 507 #endif
506 508
507 SaveWindowPosition(); 509 // Do not update the position when the window is no longer visible.
510 if (native_app_window_->GetNativeWindow()->IsVisible())
511 SaveWindowPosition();
508 512
509 #if defined(OS_WIN) 513 #if defined(OS_WIN)
510 if (cached_always_on_top_ && !IsFullscreen() && 514 if (cached_always_on_top_ && !IsFullscreen() &&
511 !native_app_window_->IsMaximized() && 515 !native_app_window_->IsMaximized() &&
512 !native_app_window_->IsMinimized()) { 516 !native_app_window_->IsMinimized()) {
513 UpdateNativeAlwaysOnTop(); 517 UpdateNativeAlwaysOnTop();
514 } 518 }
515 #endif 519 #endif
516 520
517 if (app_window_contents_) 521 if (app_window_contents_)
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
1116 region.bounds.x(), 1120 region.bounds.x(),
1117 region.bounds.y(), 1121 region.bounds.y(),
1118 region.bounds.right(), 1122 region.bounds.right(),
1119 region.bounds.bottom(), 1123 region.bounds.bottom(),
1120 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); 1124 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op);
1121 } 1125 }
1122 return sk_region; 1126 return sk_region;
1123 } 1127 }
1124 1128
1125 } // namespace extensions 1129 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698