OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/views/tab_contents/tab_contents_view_views.h" | 5 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "chrome/browser/download/download_shelf.h" | 9 #include "chrome/browser/download/download_shelf.h" |
10 #include "chrome/browser/renderer_host/render_view_host.h" | 10 #include "chrome/browser/renderer_host/render_view_host.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 WebDragOperationsMask ops, | 123 WebDragOperationsMask ops, |
124 const SkBitmap& image, | 124 const SkBitmap& image, |
125 const gfx::Point& image_offset) { | 125 const gfx::Point& image_offset) { |
126 // TODO(anicolao): implement dragging | 126 // TODO(anicolao): implement dragging |
127 } | 127 } |
128 | 128 |
129 void TabContentsViewViews::SetPageTitle(const std::wstring& title) { | 129 void TabContentsViewViews::SetPageTitle(const std::wstring& title) { |
130 // TODO(anicolao): figure out if there's anything useful to do here | 130 // TODO(anicolao): figure out if there's anything useful to do here |
131 } | 131 } |
132 | 132 |
133 void TabContentsViewViews::OnTabCrashed() { | 133 void TabContentsViewViews::OnTabCrashed(base::TerminationStatus status, |
| 134 int /* error_code */) { |
134 if (sad_tab_ != NULL) | 135 if (sad_tab_ != NULL) |
135 return; | 136 return; |
136 | 137 |
137 sad_tab_.reset(new SadTabView(tab_contents())); | 138 sad_tab_.reset(new SadTabView( |
| 139 tab_contents(), |
| 140 status == TERMINATION_STATUS_PROCESS_WAS_KILLED ? |
| 141 SadTabView::KILLED : SadTabView::CRASHED)); |
138 RemoveAllChildViews(true); | 142 RemoveAllChildViews(true); |
139 AddChildView(sad_tab_.get()); | 143 AddChildView(sad_tab_.get()); |
140 Layout(); | 144 Layout(); |
141 } | 145 } |
142 | 146 |
143 void TabContentsViewViews::SizeContents(const gfx::Size& size) { | 147 void TabContentsViewViews::SizeContents(const gfx::Size& size) { |
144 WasSized(size); | 148 WasSized(size); |
145 | 149 |
146 // We need to send this immediately. | 150 // We need to send this immediately. |
147 RenderWidgetHostView* rwhv = tab_contents()->GetRenderWidgetHostView(); | 151 RenderWidgetHostView* rwhv = tab_contents()->GetRenderWidgetHostView(); |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 rwhv->SetSize(size); | 321 rwhv->SetSize(size); |
318 | 322 |
319 if (needs_resize) | 323 if (needs_resize) |
320 SetFloatingPosition(size); | 324 SetFloatingPosition(size); |
321 } | 325 } |
322 | 326 |
323 void TabContentsViewViews::SetFloatingPosition(const gfx::Size& size) { | 327 void TabContentsViewViews::SetFloatingPosition(const gfx::Size& size) { |
324 // TODO(anicolao): rework this once we have DOMUI views for dialogs | 328 // TODO(anicolao): rework this once we have DOMUI views for dialogs |
325 SetBounds(x(), y(), size.width(), size.height()); | 329 SetBounds(x(), y(), size.width(), size.height()); |
326 } | 330 } |
OLD | NEW |