Commit 95055768 authored by jennb@chromium.org's avatar jennb@chromium.org

Created new PanelStrip base class and make DockedPanelStrip and OverflowPanelStrip its subclasses.

Part of refactor to allow for a DetachedPanelStrip.
Refactor of Panel to know it's current panel strip will be a separate patch.

BUG=None
TEST=No new tests

Review URL: https://chromiumcodereview.appspot.com/9353002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120809 0039d316-1c4b-4281-b951-d872f2087c98
parent 36531220
......@@ -57,7 +57,8 @@ const int DockedPanelStrip::kPanelMinWidth = 100;
const int DockedPanelStrip::kPanelMinHeight = 20;
DockedPanelStrip::DockedPanelStrip(PanelManager* panel_manager)
: panel_manager_(panel_manager),
: PanelStrip(PanelStrip::DOCKED),
panel_manager_(panel_manager),
minimized_panel_count_(0),
are_titlebars_up_(false),
dragging_panel_index_(kInvalidPanelIndex),
......@@ -73,17 +74,17 @@ DockedPanelStrip::~DockedPanelStrip() {
DCHECK_EQ(0, minimized_panel_count_);
}
void DockedPanelStrip::SetDisplayArea(const gfx::Rect& new_area) {
if (display_area_ == new_area)
void DockedPanelStrip::SetDisplayArea(const gfx::Rect& display_area) {
if (display_area_ == display_area)
return;
gfx::Rect old_area = display_area_;
display_area_ = new_area;
display_area_ = display_area;
if (panels_.empty())
return;
Rearrange();
RefreshLayout();
}
void DockedPanelStrip::AddPanel(Panel* panel) {
......@@ -182,7 +183,7 @@ int DockedPanelStrip::GetRightMostAvailablePosition() const {
(panels_.back()->GetBounds().x() - kPanelsHorizontalSpacing);
}
bool DockedPanelStrip::Remove(Panel* panel) {
bool DockedPanelStrip::RemovePanel(Panel* panel) {
if (panel->has_temporary_layout()) {
panels_in_temporary_layout_.erase(panel);
return true;
......@@ -202,7 +203,7 @@ bool DockedPanelStrip::Remove(Panel* panel) {
// Don't rearrange the strip if a panel is being moved from the panel strip
// to the overflow strip.
if (panel->expansion_state() != Panel::IN_OVERFLOW)
Rearrange();
RefreshLayout();
return true;
}
......@@ -211,7 +212,7 @@ void DockedPanelStrip::DelayedRemove() {
for (size_t i = 0; i < panels_pending_to_remove_.size(); ++i)
DoRemove(panels_pending_to_remove_[i]);
panels_pending_to_remove_.clear();
Rearrange();
RefreshLayout();
}
bool DockedPanelStrip::DoRemove(Panel* panel) {
......@@ -364,7 +365,7 @@ void DockedPanelStrip::OnPanelExpansionStateChanged(Panel* panel) {
Panel::ExpansionState expansion_state = panel->expansion_state();
Panel::ExpansionState old_state = panel->old_expansion_state();
if (old_state == Panel::IN_OVERFLOW) {
panel_manager_->overflow_strip()->Remove(panel);
panel_manager_->overflow_strip()->RemovePanel(panel);
AddPanel(panel);
panel->SetAppIconVisibility(true);
panel->set_draggable(true);
......@@ -428,7 +429,7 @@ void DockedPanelStrip::DecrementMinimizedPanels() {
panel_manager_->mouse_watcher()->RemoveObserver(this);
}
void DockedPanelStrip::OnWindowSizeChanged(
void DockedPanelStrip::ResizePanelWindow(
Panel* panel, const gfx::Size& preferred_window_size) {
// The panel width:
// * cannot grow or shrink to go beyond [min_width, max_width]
......@@ -472,7 +473,7 @@ void DockedPanelStrip::OnWindowSizeChanged(
// Only need to rearrange if panel's width changed.
if (delta_x != 0)
Rearrange();
RefreshLayout();
}
bool DockedPanelStrip::ShouldBringUpTitlebars(int mouse_x, int mouse_y) const {
......@@ -644,7 +645,7 @@ void DockedPanelStrip::OnFullScreenModeChanged(bool is_full_screen) {
panels_[i]->FullScreenModeChanged(is_full_screen);
}
void DockedPanelStrip::Rearrange() {
void DockedPanelStrip::RefreshLayout() {
int rightmost_position = StartingRightPosition();
size_t panel_index = 0;
......@@ -707,7 +708,7 @@ void DockedPanelStrip::DelayedMovePanelToOverflow(Panel* panel) {
}
}
void DockedPanelStrip::RemoveAll() {
void DockedPanelStrip::CloseAll() {
// This should only be called at the end of tests to clean up.
DCHECK(dragging_panel_index_ == kInvalidPanelIndex);
DCHECK(panels_in_temporary_layout_.empty());
......
......@@ -12,6 +12,7 @@
#include "base/memory/weak_ptr.h"
#include "chrome/browser/ui/panels/auto_hiding_desktop_bar.h"
#include "chrome/browser/ui/panels/panel.h"
#include "chrome/browser/ui/panels/panel_strip.h"
#include "chrome/browser/ui/panels/panel_mouse_watcher_observer.h"
#include "ui/gfx/rect.h"
......@@ -22,24 +23,38 @@ class PanelManager;
// positioning the panels and controlling how they are displayed.
// Panels in the strip appear minimized, showing title-only or expanded.
// All panels in the strip are contained within the bounds of the strip.
class DockedPanelStrip : public PanelMouseWatcherObserver {
class DockedPanelStrip : public PanelStrip,
public PanelMouseWatcherObserver {
public:
typedef std::vector<Panel*> Panels;
explicit DockedPanelStrip(PanelManager* panel_manager);
virtual ~DockedPanelStrip();
// Sets the bounds of the panel strip.
// |area| is in screen coordinates.
void SetDisplayArea(const gfx::Rect& area);
// PanelStrip OVERRIDES:
virtual void SetDisplayArea(const gfx::Rect& display_area) OVERRIDE;
// Rearranges the positions of the panels in the strip.
// Handles moving panels to/from overflow area as needed.
// This is called when the display space has been changed, i.e. working
// area being changed or a panel being closed.
virtual void RefreshLayout() OVERRIDE;
// Adds a panel to the strip. The panel may be a newly created panel or one
// that is transitioning from another grouping of panels.
void AddPanel(Panel* panel);
virtual void AddPanel(Panel* panel) OVERRIDE;
// Returns |false| if the panel is not in the strip.
bool Remove(Panel* panel);
void RemoveAll();
virtual bool RemovePanel(Panel* panel) OVERRIDE;
virtual void CloseAll() OVERRIDE;
// Invoked when the window size of the given panel needs to be changed.
virtual void ResizePanelWindow(
Panel* panel,
const gfx::Size& preferred_window_size) OVERRIDE;
// Invoked when a panel's attention state changes.
virtual void OnPanelAttentionStateChanged(Panel* panel) OVERRIDE;
// Drags the given panel.
void StartDragging(Panel* panel);
......@@ -49,13 +64,6 @@ class DockedPanelStrip : public PanelMouseWatcherObserver {
// Invoked when a panel's expansion state changes.
void OnPanelExpansionStateChanged(Panel* panel);
// Invoked when a panel's attention state changes.
void OnPanelAttentionStateChanged(Panel* panel);
// Invoked when the window size of the given panel is changed.
void OnWindowSizeChanged(
Panel* panel, const gfx::Size& preferred_window_size);
// Returns true if we should bring up the titlebars, given the current mouse
// point.
bool ShouldBringUpTitlebars(int mouse_x, int mouse_y) const;
......@@ -115,12 +123,6 @@ class DockedPanelStrip : public PanelMouseWatcherObserver {
// Returns |false| if panel is not in the strip.
bool DoRemove(Panel* panel);
// Rearranges the positions of the panels in the strip.
// Handles moving panels to/from overflow area as needed.
// This is called when the display space has been changed, i.e. working
// area being changed or a panel being closed.
void Rearrange();
// Help functions to drag the given panel.
void DragLeft();
void DragRight();
......
......@@ -32,7 +32,8 @@ const int kOverflowHoverAnimationMs = 180;
}
OverflowPanelStrip::OverflowPanelStrip(PanelManager* panel_manager)
: panel_manager_(panel_manager),
: PanelStrip(PanelStrip::IN_OVERFLOW),
panel_manager_(panel_manager),
current_display_width_(0),
max_visible_panels_(kMaxVisibleOverflowPanels),
max_visible_panels_on_hover_(0),
......@@ -59,7 +60,7 @@ void OverflowPanelStrip::SetDisplayArea(const gfx::Rect& display_area) {
if (overflow_indicator_.get())
UpdateOverflowIndicatorCount();
Refresh();
RefreshLayout();
}
void OverflowPanelStrip::UpdateMaxVisiblePanelsOnHover() {
......@@ -92,7 +93,7 @@ void OverflowPanelStrip::AddPanel(Panel* panel) {
DoRefresh(panels_.size() - 1, panels_.size() - 1);
} else {
panels_.insert(panels_.begin(), panel);
Refresh();
RefreshLayout();
}
panel->ApplyVisualStyleForStrip(OVERFLOW_STRIP);
......@@ -112,7 +113,7 @@ void OverflowPanelStrip::AddPanel(Panel* panel) {
}
}
bool OverflowPanelStrip::Remove(Panel* panel) {
bool OverflowPanelStrip::RemovePanel(Panel* panel) {
size_t index = 0;
Panels::iterator iter = panels_.begin();
for (; iter != panels_.end(); ++iter, ++index)
......@@ -138,7 +139,7 @@ bool OverflowPanelStrip::Remove(Panel* panel) {
return true;
}
void OverflowPanelStrip::RemoveAll() {
void OverflowPanelStrip::CloseAll() {
// Make a copy of the iterator as closing panels can modify the vector.
Panels panels_copy = panels_;
......@@ -148,12 +149,17 @@ void OverflowPanelStrip::RemoveAll() {
(*iter)->Close();
}
void OverflowPanelStrip::ResizePanelWindow(
Panel* panel, const gfx::Size& preferred_window_size) {
// Overflow uses its own panel window sizes.
}
void OverflowPanelStrip::OnPanelExpansionStateChanged(Panel* panel) {
// Only care about new state being overflow.
if (panel->expansion_state() != Panel::IN_OVERFLOW)
return;
panel_manager_->docked_strip()->Remove(panel);
panel_manager_->docked_strip()->RemovePanel(panel);
AddPanel(panel);
panel->SetAppIconVisibility(false);
panel->set_draggable(false);
......@@ -164,7 +170,7 @@ void OverflowPanelStrip::OnPanelAttentionStateChanged(Panel* panel) {
UpdateOverflowIndicatorAttention();
}
void OverflowPanelStrip::Refresh() {
void OverflowPanelStrip::RefreshLayout() {
if (panels_.empty())
return;
DoRefresh(0, panels_.size() - 1);
......
......@@ -8,6 +8,7 @@
#include <vector>
#include "chrome/browser/ui/panels/panel.h"
#include "chrome/browser/ui/panels/panel_strip.h"
#include "chrome/browser/ui/panels/panel_mouse_watcher_observer.h"
#include "ui/base/animation/animation_delegate.h"
......@@ -19,7 +20,8 @@ class SlideAnimation;
}
// Manipulates all the panels that are placed on the left-most overflow area.
class OverflowPanelStrip : public PanelMouseWatcherObserver,
class OverflowPanelStrip : public PanelStrip,
public PanelMouseWatcherObserver,
public ui::AnimationDelegate {
public:
typedef std::vector<Panel*> Panels;
......@@ -27,26 +29,20 @@ class OverflowPanelStrip : public PanelMouseWatcherObserver,
explicit OverflowPanelStrip(PanelManager* panel_manager);
virtual ~OverflowPanelStrip();
// Sets the display area of the overflow strip.
// |display_area| is in screen coordinates.
void SetDisplayArea(const gfx::Rect& display_area);
// Adds a panel to the strip.
void AddPanel(Panel* panel);
// Returns |false| if the panel is not in the strip.
bool Remove(Panel* panel);
void RemoveAll();
// PanelStrip OVERRIDES:
virtual void SetDisplayArea(const gfx::Rect& display_area) OVERRIDE;
virtual void RefreshLayout() OVERRIDE;
virtual void AddPanel(Panel* panel) OVERRIDE;
virtual bool RemovePanel(Panel* panel) OVERRIDE;
virtual void CloseAll() OVERRIDE;
virtual void ResizePanelWindow(
Panel* panel,
const gfx::Size& preferred_window_size) OVERRIDE;
virtual void OnPanelAttentionStateChanged(Panel* panel) OVERRIDE;
// Called when a panel's expansion state changes.
void OnPanelExpansionStateChanged(Panel* panel);
// Called when a panel is starting/stopping drawing an attention.
void OnPanelAttentionStateChanged(Panel* panel);
// Refreshes the layouts for all panels to reflect any possible changes.
void Refresh();
void OnFullScreenModeChanged(bool is_full_screen);
int num_panels() const { return static_cast<int>(panels_.size()); }
......
......@@ -968,7 +968,7 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest, MinimizeRestore) {
CreatePanelWithBounds("PanelTest1", gfx::Rect(0, 0, 100, 100));
TestMinimizeRestore();
PanelManager::GetInstance()->RemoveAll();
PanelManager::GetInstance()->CloseAll();
}
IN_PROC_BROWSER_TEST_F(PanelBrowserTest, MinimizeRestoreTwoPanels) {
......@@ -981,7 +981,7 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest, MinimizeRestoreTwoPanels) {
CreatePanelWithBounds("PanelTest2", gfx::Rect(0, 0, 110, 110));
TestMinimizeRestore();
PanelManager::GetInstance()->RemoveAll();
PanelManager::GetInstance()->CloseAll();
}
IN_PROC_BROWSER_TEST_F(PanelBrowserTest, MinimizeRestoreThreePanels) {
......@@ -995,7 +995,7 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest, MinimizeRestoreThreePanels) {
CreatePanelWithBounds("PanelTest3", gfx::Rect(0, 0, 120, 120));
TestMinimizeRestore();
PanelManager::GetInstance()->RemoveAll();
PanelManager::GetInstance()->CloseAll();
}
IN_PROC_BROWSER_TEST_F(PanelBrowserTest, ActivatePanelOrTabbedWindow) {
......
......@@ -153,9 +153,9 @@ void PanelManager::Remove(Panel* panel) {
full_screen_mode_timer_.Stop();
#endif
if (docked_strip_->Remove(panel))
if (docked_strip_->RemovePanel(panel))
return;
bool removed = overflow_strip_->Remove(panel);
bool removed = overflow_strip_->RemovePanel(panel);
DCHECK(removed);
}
......@@ -194,7 +194,7 @@ void PanelManager::OnPreferredWindowSizeChanged(
Panel* panel, const gfx::Size& preferred_window_size) {
if (!auto_sizing_enabled_)
return;
docked_strip_->OnWindowSizeChanged(panel, preferred_window_size);
docked_strip_->ResizePanelWindow(panel, preferred_window_size);
}
void PanelManager::ResizePanel(Panel* panel, const gfx::Size& new_size) {
......@@ -204,7 +204,7 @@ void PanelManager::ResizePanel(Panel* panel, const gfx::Size& new_size) {
LOG(INFO) << "Resizing auto-resizable Panels is not supported yet.";
return;
}
docked_strip_->OnWindowSizeChanged(panel, new_size);
docked_strip_->ResizePanelWindow(panel, new_size);
}
bool PanelManager::ShouldBringUpTitlebars(int mouse_x, int mouse_y) const {
......@@ -257,9 +257,9 @@ void PanelManager::OnAutoHidingDesktopBarVisibilityChanged(
docked_strip_->OnAutoHidingDesktopBarVisibilityChanged(alignment, visibility);
}
void PanelManager::RemoveAll() {
docked_strip_->RemoveAll();
overflow_strip_->RemoveAll();
void PanelManager::CloseAll() {
docked_strip_->CloseAll();
overflow_strip_->CloseAll();
}
int PanelManager::num_panels() const {
......
......@@ -37,7 +37,9 @@ class PanelManager : public AutoHidingDesktopBar::Observer {
Panel* CreatePanel(Browser* browser);
void Remove(Panel* panel);
void RemoveAll();
// Close all panels (asynchronous). Panels will be removed after closing.
void CloseAll();
// Asynchronous confirmation of panel having been removed.
void OnPanelRemoved(Panel* panel);
......
......@@ -271,7 +271,7 @@ IN_PROC_BROWSER_TEST_F(PanelOverflowBrowserTest, MAYBE_CheckPanelProperties) {
EXPECT_FALSE(panel4->has_temporary_layout());
EXPECT_FALSE(panel4->draggable());
PanelManager::GetInstance()->RemoveAll();
PanelManager::GetInstance()->CloseAll();
}
IN_PROC_BROWSER_TEST_F(PanelOverflowBrowserTest, MAYBE_UpdateDraggableStatus) {
......@@ -333,7 +333,7 @@ IN_PROC_BROWSER_TEST_F(PanelOverflowBrowserTest, MAYBE_CreateOverflowPanels) {
EXPECT_FALSE(overflow_strip->overflow_indicator());
EXPECT_TRUE(IsPanelVisible(panel4));
PanelManager::GetInstance()->RemoveAll();
PanelManager::GetInstance()->CloseAll();
}
IN_PROC_BROWSER_TEST_F(PanelOverflowBrowserTest,
......@@ -366,7 +366,7 @@ IN_PROC_BROWSER_TEST_F(PanelOverflowBrowserTest,
EXPECT_EQ(Panel::IN_OVERFLOW, panels[7]->expansion_state());
EXPECT_FALSE(IsPanelVisible(panels[7]));
PanelManager::GetInstance()->RemoveAll();
PanelManager::GetInstance()->CloseAll();
}
IN_PROC_BROWSER_TEST_F(PanelOverflowBrowserTest,
......@@ -393,7 +393,7 @@ IN_PROC_BROWSER_TEST_F(PanelOverflowBrowserTest,
WaitForExpansionStateChanged(overflow_panel, Panel::IN_OVERFLOW);
EXPECT_FALSE(overflow_panel->has_temporary_layout());
PanelManager::GetInstance()->RemoveAll();
PanelManager::GetInstance()->CloseAll();
}
IN_PROC_BROWSER_TEST_F(PanelOverflowBrowserTest, MAYBE_CloseOverflowPanels) {
......@@ -486,7 +486,7 @@ IN_PROC_BROWSER_TEST_F(PanelOverflowBrowserTest, MAYBE_CloseOverflowPanels) {
expected_overflow_list.Add(panels[7], Panel::IN_OVERFLOW, true, false);
EXPECT_EQ(expected_overflow_list, GetAllOverflowPanelData());
panel_manager->RemoveAll();
panel_manager->CloseAll();
}
IN_PROC_BROWSER_TEST_F(PanelOverflowBrowserTest, MAYBE_CloseDockedPanels) {
......@@ -614,7 +614,7 @@ IN_PROC_BROWSER_TEST_F(PanelOverflowBrowserTest, MAYBE_CloseDockedPanels) {
expected_overflow_list.Add(panels[8], Panel::IN_OVERFLOW, true, false);
EXPECT_EQ(expected_overflow_list, GetAllOverflowPanelData());
panel_manager->RemoveAll();
panel_manager->CloseAll();
}
IN_PROC_BROWSER_TEST_F(PanelOverflowBrowserTest,
......@@ -652,7 +652,7 @@ IN_PROC_BROWSER_TEST_F(PanelOverflowBrowserTest,
// Hack. Pretend to close panel by removing it directly. Cannot use
// CloseWindowAndWait() here because it will allow the delayed overflow
// to complete.
docked_strip->Remove(panel1);
docked_strip->RemovePanel(panel1);
EXPECT_EQ(1, docked_strip->num_panels());
EXPECT_EQ(1, docked_strip->num_temporary_layout_panels());
EXPECT_TRUE(overflow_panel->has_temporary_layout());
......@@ -791,7 +791,7 @@ IN_PROC_BROWSER_TEST_F(PanelOverflowBrowserTest, MAYBE_ActivateOverflowPanels) {
expected_overflow_list.Add(panels[5], Panel::IN_OVERFLOW, false, false);
EXPECT_EQ(expected_overflow_list, GetAllOverflowPanelData());
PanelManager::GetInstance()->RemoveAll();
PanelManager::GetInstance()->CloseAll();
}
IN_PROC_BROWSER_TEST_F(
......@@ -893,7 +893,7 @@ IN_PROC_BROWSER_TEST_F(
expected_overflow_list.Add(panels[4], Panel::IN_OVERFLOW, true, false);
EXPECT_EQ(expected_overflow_list, GetAllOverflowPanelData());
PanelManager::GetInstance()->RemoveAll();
PanelManager::GetInstance()->CloseAll();
}
IN_PROC_BROWSER_TEST_F(
......@@ -1089,7 +1089,7 @@ IN_PROC_BROWSER_TEST_F(
EXPECT_EQ(expected_overflow_list, GetAllOverflowPanelData());
}
PanelManager::GetInstance()->RemoveAll();
PanelManager::GetInstance()->CloseAll();
}
IN_PROC_BROWSER_TEST_F(PanelOverflowBrowserTest,
......@@ -1160,7 +1160,7 @@ IN_PROC_BROWSER_TEST_F(PanelOverflowBrowserTest,
EXPECT_EQ(iconified_width, panels[3]->GetBounds().width());
EXPECT_EQ(iconified_width, panels[4]->GetBounds().width());
panel_manager->RemoveAll();
panel_manager->CloseAll();
}
IN_PROC_BROWSER_TEST_F(PanelOverflowBrowserTest,
......@@ -1266,7 +1266,7 @@ IN_PROC_BROWSER_TEST_F(PanelOverflowBrowserTest,
EXPECT_EQ(0, panels[6]->GetBounds().width());
EXPECT_EQ(0, panels[7]->GetBounds().width());
panel_manager->RemoveAll();
panel_manager->CloseAll();
}
IN_PROC_BROWSER_TEST_F(PanelOverflowBrowserTest, MAYBE_ResizePanel) {
......@@ -1478,7 +1478,7 @@ IN_PROC_BROWSER_TEST_F(PanelOverflowBrowserTest, MAYBE_OverflowIndicatorCount) {
EXPECT_FALSE(IsPanelVisible(panels[10]));
EXPECT_EQ(4, overflow_strip->overflow_indicator()->GetCount());
panel_manager->RemoveAll();
panel_manager->CloseAll();
}
IN_PROC_BROWSER_TEST_F(PanelOverflowBrowserTest, MAYBE_DrawOverflowAttention) {
......@@ -1591,5 +1591,5 @@ IN_PROC_BROWSER_TEST_F(PanelOverflowBrowserTest, MAYBE_DrawOverflowAttention) {
EXPECT_TRUE(panels[3]->IsDrawingAttention());
EXPECT_FALSE(overflow_indicator->IsDrawingAttention());
panel_manager->RemoveAll();
panel_manager->CloseAll();
}
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/panels/panel_strip.h"
PanelStrip::PanelStrip(Type type)
: type_(type) {
}
PanelStrip::~PanelStrip() {
}
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_PANELS_PANEL_STRIP_H_
#define CHROME_BROWSER_UI_PANELS_PANEL_STRIP_H_
#pragma once
#include "ui/gfx/rect.h"
class Panel;
// Common base class for a collection of panels. Subclasses manage
// various layouts for displaying panels in the collection.
class PanelStrip {
public:
// Types of layout for the panel collections.
enum Type {
DETACHED, // free-floating panels
DOCKED, // panels are 'docked' along the window's edge
IN_OVERFLOW, // panels that cannot fit in the 'docked' panels area
};
Type type() const { return type_; }
// Sets the bounds of the panel strip.
// |display_area| is in screen coordinates.
virtual void SetDisplayArea(const gfx::Rect& display_area) = 0;
// Updates the positioning of all panels in the collection, usually as
// a result of removing or resizing a panel in collection.
virtual void RefreshLayout() = 0;
// Adds |panel| to the collection of panels.
virtual void AddPanel(Panel* panel) = 0;
// Removes |panel| from the collection of panels. Invoked asynchronously
// after a panel has been closed.
// Returns |false| if the panel is not in the strip.
virtual bool RemovePanel(Panel* panel) = 0;
// Closes all panels in the collection. Panels will be removed after closing.
virtual void CloseAll() = 0;
// Resizes the |panel| to the |preferred_window_size|.
// |preferred_window_size| is the outer dimensions of the window, not
// the content area, and is in screen coordinates.
// The preferred size may be adjusted to fit layout constraints.
virtual void ResizePanelWindow(Panel* panel,
const gfx::Size& preferred_window_size) = 0;
// Invoked when the draw attention state of the panel has changed.
// Subclass should update the display of the panel to match the new
// draw attention state.
virtual void OnPanelAttentionStateChanged(Panel* panel) = 0;
protected:
explicit PanelStrip(Type type);
virtual ~PanelStrip();
const Type type_; // Type of this panel strip.
};
#endif // CHROME_BROWSER_UI_PANELS_PANEL_STRIP_H_
......@@ -3309,6 +3309,8 @@
'browser/ui/panels/panel_overflow_indicator_view.h',
'browser/ui/panels/panel_settings_menu_model.cc',
'browser/ui/panels/panel_settings_menu_model.h',
'browser/ui/panels/panel_strip.cc',
'browser/ui/panels/panel_strip.h',
'browser/ui/panels/panel_titlebar_view_cocoa.h',
'browser/ui/panels/panel_titlebar_view_cocoa.mm',
'browser/ui/panels/panel_window_controller_cocoa.h',
......
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