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

Side by Side Diff: chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc

Issue 5785001: A NativeViewHostViews class for embedding views inside NativeHostView instances. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed up the patchset to not include files that I pulled in by accident in #3 Created 10 years 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/ui/views/dom_view.cc ('k') | views/controls/native/native_view_host.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 tab_contents()->interstitial_page()->Focus(); 154 tab_contents()->interstitial_page()->Focus();
155 return; 155 return;
156 } 156 }
157 157
158 if (tab_contents()->is_crashed() && sad_tab_ != NULL) { 158 if (tab_contents()->is_crashed() && sad_tab_ != NULL) {
159 sad_tab_->RequestFocus(); 159 sad_tab_->RequestFocus();
160 return; 160 return;
161 } 161 }
162 162
163 RenderWidgetHostView* rwhv = tab_contents()->GetRenderWidgetHostView(); 163 RenderWidgetHostView* rwhv = tab_contents()->GetRenderWidgetHostView();
164 gtk_widget_grab_focus(rwhv ? rwhv->GetNativeView() : GetNativeView()); 164 if (rwhv)
165 rwhv->Focus();
165 } 166 }
166 167
167 void TabContentsViewViews::SetInitialFocus() { 168 void TabContentsViewViews::SetInitialFocus() {
168 if (tab_contents()->FocusLocationBarByDefault()) 169 if (tab_contents()->FocusLocationBarByDefault())
169 tab_contents()->SetFocusToLocationBar(false); 170 tab_contents()->SetFocusToLocationBar(false);
170 else 171 else
171 Focus(); 172 Focus();
172 } 173 }
173 174
174 void TabContentsViewViews::StoreFocus() { 175 void TabContentsViewViews::StoreFocus() {
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 rwhv->SetSize(size); 317 rwhv->SetSize(size);
317 318
318 if (needs_resize) 319 if (needs_resize)
319 SetFloatingPosition(size); 320 SetFloatingPosition(size);
320 } 321 }
321 322
322 void TabContentsViewViews::SetFloatingPosition(const gfx::Size& size) { 323 void TabContentsViewViews::SetFloatingPosition(const gfx::Size& size) {
323 // TODO(anicolao): rework this once we have DOMUI views for dialogs 324 // TODO(anicolao): rework this once we have DOMUI views for dialogs
324 SetBounds(x(), y(), size.width(), size.height()); 325 SetBounds(x(), y(), size.width(), size.height());
325 } 326 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/dom_view.cc ('k') | views/controls/native/native_view_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698