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

Side by Side Diff: ash/wm/frame_painter.cc

Issue 25374002: Fixes use after free caused by delete in RootWindowController (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Back to explicitly destroying with comment Created 7 years, 2 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
« no previous file with comments | « ash/root_window_controller_unittest.cc ('k') | ui/aura/window.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ash/wm/frame_painter.h" 5 #include "ash/wm/frame_painter.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/ash_constants.h" 9 #include "ash/ash_constants.h"
10 #include "ash/root_window_controller.h" 10 #include "ash/root_window_controller.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 window->layer() && 170 window->layer() &&
171 window->layer()->type() != ui::LAYER_NOT_DRAWN && 171 window->layer()->type() != ui::LAYER_NOT_DRAWN &&
172 window->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_NONE && 172 window->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_NONE &&
173 !window->GetProperty(ash::kConstrainedWindowKey); 173 !window->GetProperty(ash::kConstrainedWindowKey);
174 } 174 }
175 175
176 // Returns a list of windows in |root_window|| that potentially could have 176 // Returns a list of windows in |root_window|| that potentially could have
177 // a transparent solo-window header. 177 // a transparent solo-window header.
178 std::vector<Window*> GetWindowsForSoloHeaderUpdate(RootWindow* root_window) { 178 std::vector<Window*> GetWindowsForSoloHeaderUpdate(RootWindow* root_window) {
179 std::vector<Window*> windows; 179 std::vector<Window*> windows;
180 // During shutdown there may not be a workspace controller. In that case
181 // we don't care about updating any windows.
182 // Avoid memory allocations for typical window counts. 180 // Avoid memory allocations for typical window counts.
183 windows.reserve(16); 181 windows.reserve(16);
184 // Collect windows from the desktop. 182 // Collect windows from the desktop.
185 Window* desktop = ash::Shell::GetContainer( 183 Window* desktop = ash::Shell::GetContainer(
186 root_window, ash::internal::kShellWindowId_DefaultContainer); 184 root_window, ash::internal::kShellWindowId_DefaultContainer);
187 windows.insert(windows.end(), 185 windows.insert(windows.end(),
188 desktop->children().begin(), 186 desktop->children().begin(),
189 desktop->children().end()); 187 desktop->children().end());
190 // Collect "always on top" windows. 188 // Collect "always on top" windows.
191 Window* top_container = 189 Window* top_container =
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 // icon. Don't use |window_icon_| for this computation as it may be NULL. 833 // icon. Don't use |window_icon_| for this computation as it may be NULL.
836 int title_y = GetCaptionButtonContainerCenterY() - title_font.GetHeight() / 2; 834 int title_y = GetCaptionButtonContainerCenterY() - title_font.GetHeight() / 2;
837 return gfx::Rect( 835 return gfx::Rect(
838 title_x, 836 title_x,
839 std::max(0, title_y), 837 std::max(0, title_y),
840 std::max(0, caption_button_container_->x() - kTitleLogoSpacing - title_x), 838 std::max(0, caption_button_container_->x() - kTitleLogoSpacing - title_x),
841 title_font.GetHeight()); 839 title_font.GetHeight());
842 } 840 }
843 841
844 } // namespace ash 842 } // namespace ash
OLDNEW
« no previous file with comments | « ash/root_window_controller_unittest.cc ('k') | ui/aura/window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698