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

Side by Side Diff: chrome/views/custom_frame_window.cc

Issue 20051: Paper over a crash that I think is due to the way we shut down the view hiera... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 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 | « 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 (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/views/custom_frame_window.h" 5 #include "chrome/views/custom_frame_window.h"
6 6
7 #include "base/gfx/point.h" 7 #include "base/gfx/point.h"
8 #include "base/gfx/size.h" 8 #include "base/gfx/size.h"
9 #include "base/win_util.h" 9 #include "base/win_util.h"
10 #include "chrome/app/theme/theme_resources.h" 10 #include "chrome/app/theme/theme_resources.h"
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 // The bottom of the titlebar actually comes from the top of the Client Edge 667 // The bottom of the titlebar actually comes from the top of the Client Edge
668 // graphic, with the actual client edge clipped off the bottom. 668 // graphic, with the actual client edge clipped off the bottom.
669 SkBitmap* titlebar_bottom = resources()->GetPartBitmap(FRAME_CLIENT_EDGE_TOP); 669 SkBitmap* titlebar_bottom = resources()->GetPartBitmap(FRAME_CLIENT_EDGE_TOP);
670 int edge_height = titlebar_bottom->height() - kClientEdgeThickness; 670 int edge_height = titlebar_bottom->height() - kClientEdgeThickness;
671 canvas->TileImageInt(*titlebar_bottom, 0, 671 canvas->TileImageInt(*titlebar_bottom, 0,
672 container_->client_view()->y() - edge_height, width(), edge_height); 672 container_->client_view()->y() - edge_height, width(), edge_height);
673 } 673 }
674 674
675 void DefaultNonClientView::PaintTitleBar(ChromeCanvas* canvas) { 675 void DefaultNonClientView::PaintTitleBar(ChromeCanvas* canvas) {
676 WindowDelegate* d = container_->window_delegate(); 676 WindowDelegate* d = container_->window_delegate();
677
678 // It seems like in some conditions we can be asked to paint after the window
679 // that contains us is WM_DESTROYed. At this point, our delegate is NULL. The
680 // correct long term fix may be to shut down the RootView in WM_DESTROY.
681 if (!d)
682 return;
683
677 canvas->DrawStringInt(d->GetWindowTitle(), title_font_, SK_ColorWHITE, 684 canvas->DrawStringInt(d->GetWindowTitle(), title_font_, SK_ColorWHITE,
678 MirroredLeftPointForRect(title_bounds_), title_bounds_.y(), 685 MirroredLeftPointForRect(title_bounds_), title_bounds_.y(),
679 title_bounds_.width(), title_bounds_.height()); 686 title_bounds_.width(), title_bounds_.height());
680 } 687 }
681 688
682 void DefaultNonClientView::PaintRestoredClientEdge(ChromeCanvas* canvas) { 689 void DefaultNonClientView::PaintRestoredClientEdge(ChromeCanvas* canvas) {
683 gfx::Rect client_area_bounds = container_->client_view()->bounds(); 690 gfx::Rect client_area_bounds = container_->client_view()->bounds();
684 int client_area_top = client_area_bounds.y(); 691 int client_area_top = client_area_bounds.y();
685 692
686 SkBitmap* top_left = resources()->GetPartBitmap(FRAME_CLIENT_EDGE_TOP_LEFT); 693 SkBitmap* top_left = resources()->GetPartBitmap(FRAME_CLIENT_EDGE_TOP_LEFT);
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
1321 if ((GetKeyState(VK_CONTROL) & 0x80) == 0x80) 1328 if ((GetKeyState(VK_CONTROL) & 0x80) == 0x80)
1322 message_flags |= MK_CONTROL; 1329 message_flags |= MK_CONTROL;
1323 if ((GetKeyState(VK_SHIFT) & 0x80) == 0x80) 1330 if ((GetKeyState(VK_SHIFT) & 0x80) == 0x80)
1324 message_flags |= MK_SHIFT; 1331 message_flags |= MK_SHIFT;
1325 message_flags |= flags; 1332 message_flags |= flags;
1326 ProcessMousePressed(temp, message_flags, false); 1333 ProcessMousePressed(temp, message_flags, false);
1327 } 1334 }
1328 1335
1329 } // namespace views 1336 } // namespace views
1330 1337
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