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

Unified Diff: chrome/browser/ui/panels/panel.cc

Issue 8827011: Panel strip refactor cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced Created 9 years 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
« no previous file with comments | « chrome/browser/ui/panels/panel.h ('k') | chrome/browser/ui/panels/panel_browser_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/panels/panel.cc
diff --git a/chrome/browser/ui/panels/panel.cc b/chrome/browser/ui/panels/panel.cc
index 4667065e30fc1494b0f222354dda098e56e657e7..8af6c4066efcc2ec3d0e91d20f60b4ee51179b08 100644
--- a/chrome/browser/ui/panels/panel.cc
+++ b/chrome/browser/ui/panels/panel.cc
@@ -12,8 +12,6 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/panels/native_panel.h"
#include "chrome/browser/ui/panels/panel_manager.h"
-#include "chrome/browser/ui/panels/panel_overflow_strip.h"
-#include "chrome/browser/ui/panels/panel_strip.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/browser/ui/window_sizer.h"
#include "chrome/browser/web_applications/web_app.h"
@@ -38,9 +36,11 @@ const Extension* Panel::GetExtensionFromBrowser(Browser* browser) {
Panel::Panel(Browser* browser, const gfx::Size& requested_size)
: browser_(browser),
initialized_(false),
+ has_temporary_layout_(false),
restored_size_(requested_size),
auto_resizable_(false),
- expansion_state_(EXPANDED) {
+ expansion_state_(EXPANDED),
+ app_icon_visible_(true) {
}
Panel::~Panel() {
@@ -120,6 +120,13 @@ void Panel::SetSizeRange(const gfx::Size& min_size, const gfx::Size& max_size) {
ConfigureAutoResize(browser()->GetSelectedTabContents());
}
+void Panel::SetAppIconVisibility(bool visible) {
+ if (app_icon_visible_ == visible)
+ return;
+ app_icon_visible_ = visible;
+ native_panel_->SetPanelAppIconVisibility(visible);
+}
+
void Panel::SetExpansionState(ExpansionState new_state) {
if (expansion_state_ == new_state)
return;
@@ -138,26 +145,6 @@ void Panel::SetExpansionState(ExpansionState new_state) {
content::NotificationService::NoDetails());
}
-bool Panel::ShouldBringUpTitlebar(int mouse_x, int mouse_y) const {
- // Skip the expanded panel.
- if (expansion_state_ == EXPANDED)
- return false;
-
- // If the panel is showing titlebar only, we want to keep it up when it is
- // being dragged.
- if (expansion_state_ == TITLE_ONLY && manager()->is_dragging_panel())
- return true;
-
- // We do not want to bring up other minimized panels if the mouse is over the
- // panel that pops up the title-bar to attract attention.
- if (native_panel_->IsDrawingAttention())
- return false;
-
- gfx::Rect bounds = native_panel_->GetPanelBounds();
- return bounds.x() <= mouse_x && mouse_x <= bounds.right() &&
- mouse_y >= bounds.y();
-}
-
bool Panel::IsDrawingAttention() const {
return native_panel_->IsDrawingAttention();
}
@@ -189,16 +176,7 @@ void Panel::Close() {
native_panel_->ClosePanel();
}
-void Panel::MoveOutOfOverflow() {
- if (expansion_state_ != Panel::IN_OVERFLOW)
- return;
- manager()->panel_overflow_strip()->Remove(this);
- manager()->panel_strip()->AddPanel(this);
-}
-
void Panel::Activate() {
- MoveOutOfOverflow();
-
// Make sure the panel is expanded when activated programmatically,
// so the user input does not go into collapsed window.
SetExpansionState(Panel::EXPANDED);
« no previous file with comments | « chrome/browser/ui/panels/panel.h ('k') | chrome/browser/ui/panels/panel_browser_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698