OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/tab_contents/tab_contents.h" | 5 #include "chrome/browser/tab_contents/tab_contents.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/file_version_info.h" | 9 #include "base/file_version_info.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
(...skipping 1886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1897 } | 1897 } |
1898 } | 1898 } |
1899 } | 1899 } |
1900 | 1900 |
1901 void TabContents::UpdateInspectorSettings(const std::wstring& raw_settings) { | 1901 void TabContents::UpdateInspectorSettings(const std::wstring& raw_settings) { |
1902 profile()->GetPrefs()->SetString(prefs::kWebKitInspectorSettings, | 1902 profile()->GetPrefs()->SetString(prefs::kWebKitInspectorSettings, |
1903 raw_settings); | 1903 raw_settings); |
1904 } | 1904 } |
1905 | 1905 |
1906 void TabContents::Close(RenderViewHost* rvh) { | 1906 void TabContents::Close(RenderViewHost* rvh) { |
| 1907 // If we close the tab while we're in the middle of a drag, we'll crash. |
| 1908 // Instead, cancel the drag and close it as soon as the drag ends. |
| 1909 if (view()->IsDoingDrag()) { |
| 1910 view()->CancelDragAndCloseTab(); |
| 1911 return; |
| 1912 } |
| 1913 |
1907 // Ignore this if it comes from a RenderViewHost that we aren't showing. | 1914 // Ignore this if it comes from a RenderViewHost that we aren't showing. |
1908 if (delegate() && rvh == render_view_host()) | 1915 if (delegate() && rvh == render_view_host()) |
1909 delegate()->CloseContents(this); | 1916 delegate()->CloseContents(this); |
1910 } | 1917 } |
1911 | 1918 |
1912 void TabContents::RequestMove(const gfx::Rect& new_bounds) { | 1919 void TabContents::RequestMove(const gfx::Rect& new_bounds) { |
1913 if (delegate() && delegate()->IsPopup(this)) | 1920 if (delegate() && delegate()->IsPopup(this)) |
1914 delegate()->MoveContents(this, new_bounds); | 1921 delegate()->MoveContents(this, new_bounds); |
1915 } | 1922 } |
1916 | 1923 |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2343 NavigationController::LoadCommittedDetails& committed_details = | 2350 NavigationController::LoadCommittedDetails& committed_details = |
2344 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); | 2351 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); |
2345 ExpireInfoBars(committed_details); | 2352 ExpireInfoBars(committed_details); |
2346 break; | 2353 break; |
2347 } | 2354 } |
2348 | 2355 |
2349 default: | 2356 default: |
2350 NOTREACHED(); | 2357 NOTREACHED(); |
2351 } | 2358 } |
2352 } | 2359 } |
OLD | NEW |