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

Unified Diff: chrome/browser/ui/views/constrained_window_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 regression now that shutdown timing was changed for views. 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/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() {

Powered by Google App Engine
This is Rietveld 408576698