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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 // if the location bar was focused and the tab is dragged out), or it may | 214 // if the location bar was focused and the tab is dragged out), or it may |
215 // no longer be focusable (e.g. if the location bar was focused and then | 215 // no longer be focusable (e.g. if the location bar was focused and then |
216 // we switched to fullscreen mode). In that case we default to the | 216 // we switched to fullscreen mode). In that case we default to the |
217 // default focus. | 217 // default focus. |
218 SetInitialFocus(); | 218 SetInitialFocus(); |
219 } | 219 } |
220 view_storage->RemoveView(last_focused_view_storage_id_); | 220 view_storage->RemoveView(last_focused_view_storage_id_); |
221 } | 221 } |
222 } | 222 } |
223 | 223 |
| 224 void TabContentsViewViews::GetViewBounds(gfx::Rect* out) const { |
| 225 out->SetRect(x(), y(), width(), height()); |
| 226 } |
| 227 |
224 void TabContentsViewViews::DidChangeBounds(const gfx::Rect& previous, | 228 void TabContentsViewViews::DidChangeBounds(const gfx::Rect& previous, |
225 const gfx::Rect& current) { | 229 const gfx::Rect& current) { |
226 if (IsVisibleInRootView()) | 230 if (IsVisibleInRootView()) |
227 WasSized(gfx::Size(current.width(), current.height())); | 231 WasSized(gfx::Size(current.width(), current.height())); |
228 } | 232 } |
229 | 233 |
230 void TabContentsViewViews::Paint(gfx::Canvas* canvas) { | 234 void TabContentsViewViews::Paint(gfx::Canvas* canvas) { |
231 } | 235 } |
232 | 236 |
233 void TabContentsViewViews::UpdateDragCursor(WebDragOperation operation) { | 237 void TabContentsViewViews::UpdateDragCursor(WebDragOperation operation) { |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 rwhv->SetSize(size); | 325 rwhv->SetSize(size); |
322 | 326 |
323 if (needs_resize) | 327 if (needs_resize) |
324 SetFloatingPosition(size); | 328 SetFloatingPosition(size); |
325 } | 329 } |
326 | 330 |
327 void TabContentsViewViews::SetFloatingPosition(const gfx::Size& size) { | 331 void TabContentsViewViews::SetFloatingPosition(const gfx::Size& size) { |
328 // TODO(anicolao): rework this once we have DOMUI views for dialogs | 332 // TODO(anicolao): rework this once we have DOMUI views for dialogs |
329 SetBounds(x(), y(), size.width(), size.height()); | 333 SetBounds(x(), y(), size.width(), size.height()); |
330 } | 334 } |
OLD | NEW |