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

Side by Side Diff: chrome/browser/ui/panels/panel_browser_view.cc

Issue 9546001: Support detaching/attaching panels via inter-strip drags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix per feedback Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/panels/panel_browser_view.h" 5 #include "chrome/browser/ui/panels/panel_browser_view.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "chrome/browser/native_window_notification_source.h" 9 #include "chrome/browser/native_window_notification_source.h"
10 #include "chrome/browser/ui/panels/panel.h" 10 #include "chrome/browser/ui/panels/panel.h"
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 mouse_pressed_ = false; 517 mouse_pressed_ = false;
518 518
519 mouse_dragging_state_ = DRAGGING_ENDED; 519 mouse_dragging_state_ = DRAGGING_ENDED;
520 panel_->manager()->EndDragging(cancelled); 520 panel_->manager()->EndDragging(cancelled);
521 return true; 521 return true;
522 } 522 }
523 523
524 void PanelBrowserView::SetPanelAppIconVisibility(bool visible) { 524 void PanelBrowserView::SetPanelAppIconVisibility(bool visible) {
525 #if defined(OS_WIN) && !defined(USE_AURA) 525 #if defined(OS_WIN) && !defined(USE_AURA)
526 gfx::NativeWindow native_window = GetNativeHandle(); 526 gfx::NativeWindow native_window = GetNativeHandle();
527 ::ShowWindow(native_window, SW_HIDE);
528 int style = ::GetWindowLong(native_window, GWL_EXSTYLE); 527 int style = ::GetWindowLong(native_window, GWL_EXSTYLE);
528 int new_style = style;
529 if (visible) 529 if (visible)
530 style &= (~WS_EX_TOOLWINDOW); 530 new_style &= (~WS_EX_TOOLWINDOW);
531 else 531 else
532 style |= WS_EX_TOOLWINDOW; 532 new_style |= WS_EX_TOOLWINDOW;
533 ::SetWindowLong(native_window, GWL_EXSTYLE, style); 533 if (style != new_style) {
534 ::ShowWindow(native_window, SW_SHOWNA); 534 ::ShowWindow(native_window, SW_HIDE);
535 ::SetWindowLong(native_window, GWL_EXSTYLE, new_style);
536 ::ShowWindow(native_window, SW_SHOWNA);
537 }
535 #else 538 #else
536 NOTIMPLEMENTED(); 539 NOTIMPLEMENTED();
537 #endif 540 #endif
538 } 541 }
539 542
543 void PanelBrowserView::SetPanelAlwaysOnTop(bool on_top) {
544 GetWidget()->SetAlwaysOnTop(on_top);
545 }
546
540 // NativePanelTesting implementation. 547 // NativePanelTesting implementation.
541 class NativePanelTestingWin : public NativePanelTesting { 548 class NativePanelTestingWin : public NativePanelTesting {
542 public: 549 public:
543 explicit NativePanelTestingWin(PanelBrowserView* panel_browser_view); 550 explicit NativePanelTestingWin(PanelBrowserView* panel_browser_view);
544 551
545 private: 552 private:
546 virtual void PressLeftMouseButtonTitlebar( 553 virtual void PressLeftMouseButtonTitlebar(
547 const gfx::Point& mouse_location) OVERRIDE; 554 const gfx::Point& mouse_location) OVERRIDE;
548 virtual void ReleaseMouseButtonTitlebar() OVERRIDE; 555 virtual void ReleaseMouseButtonTitlebar() OVERRIDE;
549 virtual void DragTitlebar(const gfx::Point& mouse_location) OVERRIDE; 556 virtual void DragTitlebar(const gfx::Point& mouse_location) OVERRIDE;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 } 619 }
613 620
614 bool NativePanelTestingWin::IsWindowSizeKnown() const { 621 bool NativePanelTestingWin::IsWindowSizeKnown() const {
615 return true; 622 return true;
616 } 623 }
617 624
618 bool NativePanelTestingWin::IsAnimatingBounds() const { 625 bool NativePanelTestingWin::IsAnimatingBounds() const {
619 return panel_browser_view_->bounds_animator_.get() && 626 return panel_browser_view_->bounds_animator_.get() &&
620 panel_browser_view_->bounds_animator_->is_animating(); 627 panel_browser_view_->bounds_animator_->is_animating();
621 } 628 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698