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

Side by Side Diff: chrome/browser/views/tabs/tab.cc

Issue 16246: CRASH at Tab::OnMouseReleased... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 11 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 | « chrome/browser/views/tabs/tab.h ('k') | chrome/browser/views/tabs/tab_strip.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) 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/browser/views/tabs/tab.h" 5 #include "chrome/browser/views/tabs/tab.h"
6 6
7 #include "base/gfx/size.h" 7 #include "base/gfx/size.h"
8 #include "chrome/common/gfx/chrome_canvas.h" 8 #include "chrome/common/gfx/chrome_canvas.h"
9 #include "chrome/common/gfx/path.h" 9 #include "chrome/common/gfx/path.h"
10 #include "chrome/common/l10n_util.h" 10 #include "chrome/common/l10n_util.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 } 171 }
172 172
173 bool Tab::OnMouseDragged(const views::MouseEvent& event) { 173 bool Tab::OnMouseDragged(const views::MouseEvent& event) {
174 delegate_->ContinueDrag(event); 174 delegate_->ContinueDrag(event);
175 return true; 175 return true;
176 } 176 }
177 177
178 void Tab::OnMouseReleased(const views::MouseEvent& event, bool canceled) { 178 void Tab::OnMouseReleased(const views::MouseEvent& event, bool canceled) {
179 // Notify the drag helper that we're done with any potential drag operations. 179 // Notify the drag helper that we're done with any potential drag operations.
180 // Clean up the drag helper, which is re-created on the next mouse press. 180 // Clean up the drag helper, which is re-created on the next mouse press.
181 delegate_->EndDrag(canceled); 181 // In some cases, ending the drag will schedule the tab for destruction; if
182 // so, bail immediately, since our members are already dead and we shouldn't
183 // do anything else except drop the tab where it is.
184 if (delegate_->EndDrag(canceled))
185 return;
182 186
183 // Close tabs on middle click, but only if the button is released over the tab 187 // Close tab on middle click, but only if the button is released over the tab
184 // (normal windows behavior is to discard presses of a UI element where the 188 // (normal windows behavior is to discard presses of a UI element where the
185 // releases happen off the element). 189 // releases happen off the element).
186 if (event.IsMiddleMouseButton() && HitTest(event.location())) 190 if (event.IsMiddleMouseButton() && HitTest(event.location()))
187 delegate_->CloseTab(this); 191 delegate_->CloseTab(this);
188 } 192 }
189 193
190 bool Tab::GetTooltipText(int x, int y, std::wstring* tooltip) { 194 bool Tab::GetTooltipText(int x, int y, std::wstring* tooltip) {
191 std::wstring title = GetTitle(); 195 std::wstring title = GetTitle();
192 if (!title.empty()) { 196 if (!title.empty()) {
193 // Only show the tooltip if the title is truncated. 197 // Only show the tooltip if the title is truncated.
194 ChromeFont font; 198 ChromeFont font;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 270
267 // Close out the path. 271 // Close out the path.
268 path->lineTo(0, h); 272 path->lineTo(0, h);
269 path->close(); 273 path->close();
270 } 274 }
271 275
272 void Tab::ContextMenuClosed() { 276 void Tab::ContextMenuClosed() {
273 delegate()->StopAllHighlighting(); 277 delegate()->StopAllHighlighting();
274 menu_controller_ = NULL; 278 menu_controller_ = NULL;
275 } 279 }
OLDNEW
« no previous file with comments | « chrome/browser/views/tabs/tab.h ('k') | chrome/browser/views/tabs/tab_strip.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698