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

Unified Diff: chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc

Issue 7880003: content: Move constrained window code from TabContents to TabContentsWrapper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mac compile (add forward declaration to file that didn't have it) Created 9 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc
diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc b/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc
index 827a37bb32f172119456560849ef90e2febd0f47..0a164b9a2c030b476cedbc1427fd5d107b0c29ef 100644
--- a/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc
+++ b/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc
@@ -7,6 +7,8 @@
#include <vector>
#include "base/time.h"
+#include "chrome/browser/ui/constrained_window_tab_helper.h"
+#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/browser/ui/views/sad_tab_view.h"
#include "chrome/browser/ui/views/tab_contents/native_tab_contents_view.h"
#include "chrome/browser/ui/views/tab_contents/render_view_context_menu_views.h"
@@ -163,11 +165,20 @@ void TabContentsViewViews::Focus() {
return;
}
- if (tab_contents_->constrained_window_count() > 0) {
- ConstrainedWindow* window = *tab_contents_->constrained_window_begin();
- DCHECK(window);
- window->FocusConstrainedWindow();
- return;
+ TabContentsWrapper* wrapper =
+ TabContentsWrapper::GetCurrentWrapperForContents(tab_contents_);
+ if (wrapper) {
+ // TODO(erg): TabContents used to own constrained windows, which is why
+ // this is here. Eventually this should be ported to a containing view
+ // specializing in constrained window management.
+ ConstrainedWindowTabHelper* helper =
+ wrapper->constrained_window_tab_helper();
+ if (helper->constrained_window_count() > 0) {
+ ConstrainedWindow* window = *helper->constrained_window_begin();
+ DCHECK(window);
+ window->FocusConstrainedWindow();
+ return;
+ }
}
RenderWidgetHostView* rwhv = tab_contents_->GetRenderWidgetHostView();
« no previous file with comments | « chrome/browser/ui/views/ssl_client_certificate_selector.cc ('k') | chrome/browser/ui/webui/constrained_html_ui_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698