Index: chrome/browser/ui/views/constrained_window_views.cc |
diff --git a/chrome/browser/ui/views/constrained_window_views.cc b/chrome/browser/ui/views/constrained_window_views.cc |
index 47e8724fcbd0cec4a7e52eb330d7ad41b871fb28..475b0f927d4587ab4bfe7b2d59d07ab0fb49b371 100644 |
--- a/chrome/browser/ui/views/constrained_window_views.cc |
+++ b/chrome/browser/ui/views/constrained_window_views.cc |
@@ -8,6 +8,8 @@ |
#include "chrome/app/chrome_command_ids.h" |
#include "chrome/browser/profiles/profile.h" |
+#include "chrome/browser/ui/constrained_window_tab_helper.h" |
+#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
#include "chrome/browser/ui/toolbar/toolbar_model.h" |
#include "chrome/browser/ui/views/frame/browser_view.h" |
#include "chrome/browser/ui/window_sizer.h" |
@@ -204,7 +206,7 @@ class ConstrainedWindowFrameView |
gfx::Rect CalculateClientAreaBounds(int width, int height) const; |
SkColor GetTitleColor() const { |
- return container_->owner()->browser_context()->IsOffTheRecord() |
+ return container_->owner()->profile()->IsOffTheRecord() |
#if defined(OS_WIN) && !defined(USE_AURA) |
|| !views::NativeWidgetWin::IsAeroGlassEnabled() |
#endif |
@@ -571,18 +573,19 @@ void ConstrainedWindowFrameView::InitClass() { |
// ConstrainedWindowViews, public: |
ConstrainedWindowViews::ConstrainedWindowViews( |
- TabContents* owner, |
+ TabContentsWrapper* wrapper, |
views::WidgetDelegate* widget_delegate) |
- : owner_(owner), |
+ : wrapper_(wrapper), |
ALLOW_THIS_IN_INITIALIZER_LIST(native_constrained_window_( |
NativeConstrainedWindow::CreateNativeConstrainedWindow(this))) { |
views::Widget::InitParams params; |
params.delegate = widget_delegate; |
params.child = true; |
- params.parent = owner->GetNativeView(); |
+ params.parent = wrapper->tab_contents()->GetNativeView(); |
params.native_widget = native_constrained_window_->AsNativeWidget(); |
Init(params); |
- owner->AddConstrainedDialog(this); |
+ |
+ wrapper_->constrained_window_tab_helper()->AddConstrainedDialog(this); |
} |
ConstrainedWindowViews::~ConstrainedWindowViews() { |
@@ -595,8 +598,8 @@ void ConstrainedWindowViews::ShowConstrainedWindow() { |
// We marked the view as hidden during construction. Mark it as |
// visible now so FocusManager will let us receive focus. |
non_client_view()->SetVisible(true); |
- if (owner_->delegate()) |
- owner_->delegate()->WillShowConstrainedWindow(owner_); |
+ if (wrapper_->delegate()) |
+ wrapper_->delegate()->WillShowConstrainedWindow(wrapper_); |
Activate(); |
FocusConstrainedWindow(); |
} |
@@ -606,8 +609,8 @@ void ConstrainedWindowViews::CloseConstrainedWindow() { |
} |
void ConstrainedWindowViews::FocusConstrainedWindow() { |
- if ((!owner_->delegate() || |
- owner_->delegate()->ShouldFocusConstrainedWindow()) && |
+ if ((!wrapper_->delegate() || |
+ wrapper_->delegate()->ShouldFocusConstrainedWindow()) && |
widget_delegate() && |
widget_delegate()->GetInitiallyFocusedView()) { |
widget_delegate()->GetInitiallyFocusedView()->RequestFocus(); |
@@ -625,9 +628,7 @@ views::NonClientFrameView* ConstrainedWindowViews::CreateNonClientFrameView() { |
// ConstrainedWindowViews, NativeConstrainedWindowDelegate implementation: |
void ConstrainedWindowViews::OnNativeConstrainedWindowDestroyed() { |
- // Tell our constraining TabContents that we've gone so it can update its |
- // list. |
- owner_->WillClose(this); |
+ wrapper_->constrained_window_tab_helper()->WillClose(this); |
} |
void ConstrainedWindowViews::OnNativeConstrainedWindowMouseActivate() { |