Commit 2b1df140 authored by jianli@chromium.org's avatar jianli@chromium.org

Remove native_stack accessor from StackedPanelCollection

We should not try to access native_stack from other classes. In addition, we don't know which one to return if StackedPanelCollection is going to have more than one native stack window in the future.

BUG=223155
TEST=existing tests

Review URL: https://codereview.chromium.org/13999008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195229 0039d316-1c4b-4281-b951-d872f2087c98
parent f199af76
......@@ -11,7 +11,6 @@
#include "base/message_loop.h"
#include "chrome/browser/ui/panels/detached_panel_collection.h"
#include "chrome/browser/ui/panels/docked_panel_collection.h"
#include "chrome/browser/ui/panels/native_panel_stack_window.h"
#include "chrome/browser/ui/panels/panel_drag_controller.h"
#include "chrome/browser/ui/panels/panel_mouse_watcher.h"
#include "chrome/browser/ui/panels/panel_resize_controller.h"
......@@ -325,7 +324,7 @@ PanelCollection* PanelManager::GetCollectionForNewPanel(
continue;
// Do not add to the stack that is minimized by the system.
if (stack->native_stack()->IsMinimized())
if (stack->IsMinimized())
continue;
if (bounds.height() <= stack->GetMaximiumAvailableBottomSpace()) {
......
......@@ -604,6 +604,10 @@ void StackedPanelCollection::MoveAllDraggingPanelsInstantly(
}
}
bool StackedPanelCollection::IsMinimized() const {
return native_stack_->IsMinimized();
}
void StackedPanelCollection::UpdatePanelCornerStyle(Panel* panel) {
panel::CornerStyle corner_style;
bool at_top = panel == top_panel();
......
......@@ -65,13 +65,14 @@ class StackedPanelCollection : public PanelCollection {
void MoveAllDraggingPanelsInstantly(const gfx::Vector2d& delta_origin);
bool IsMinimized() const;
// Returns the maximum available space from the bottom of the stack. The
// maximum available space is defined as the distance between the bottom
// of the stack and the bottom of the working area, assuming that all inactive
// panels are collapsed.
int GetMaximiumAvailableBottomSpace() const;
NativePanelStackWindow* native_stack() const { return native_stack_; }
int num_panels() const { return panels_.size(); }
const Panels& panels() const { return panels_; }
Panel* top_panel() const { return panels_.empty() ? NULL : panels_.front(); }
......
......@@ -190,10 +190,8 @@ void PanelStackView::UpdateWindowOwnerForTaskbarIconAppearance(Panel* panel) {
HWND stack_window = NULL;
StackedPanelCollection* stack = panel->stack();
if (stack) {
stack_window = views::HWNDForWidget(
static_cast<PanelStackView*>(stack->native_stack())->window_);
}
if (stack)
stack_window = views::HWNDForWidget(window_);
// The extended style WS_EX_APPWINDOW is used to force a top-level window onto
// the taskbar. In order for multiple stacked panels to appear as one, this
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment