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

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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 if (!mouse_pressed_) 515 if (!mouse_pressed_)
516 return false; 516 return false;
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 // The panel should not show app icon in the desktop bar if it is in overflow.
jennb 2012/03/08 23:41:09 Delete. If you need such a comment, it belongs in
jianli 2012/03/09 21:48:58 Done.
525 #if defined(OS_WIN) && !defined(USE_AURA) 526 #if defined(OS_WIN) && !defined(USE_AURA)
526 gfx::NativeWindow native_window = GetNativeHandle(); 527 gfx::NativeWindow native_window = GetNativeHandle();
527 ::ShowWindow(native_window, SW_HIDE);
528 int style = ::GetWindowLong(native_window, GWL_EXSTYLE); 528 int style = ::GetWindowLong(native_window, GWL_EXSTYLE);
529 int new_style = style;
529 if (visible) 530 if (visible)
530 style &= (~WS_EX_TOOLWINDOW); 531 new_style &= (~WS_EX_TOOLWINDOW);
531 else 532 else
532 style |= WS_EX_TOOLWINDOW; 533 new_style |= WS_EX_TOOLWINDOW;
533 ::SetWindowLong(native_window, GWL_EXSTYLE, style); 534 if (style != new_style) {
534 ::ShowWindow(native_window, SW_SHOWNA); 535 ::ShowWindow(native_window, SW_HIDE);
536 ::SetWindowLong(native_window, GWL_EXSTYLE, new_style);
537 ::ShowWindow(native_window, SW_SHOWNA);
538 }
535 #else 539 #else
536 NOTIMPLEMENTED(); 540 NOTIMPLEMENTED();
537 #endif 541 #endif
538 } 542 }
539 543
544 void PanelBrowserView::SetPanelAlwaysOnTop(bool on_top) {
545 GetWidget()->SetAlwaysOnTop(on_top);
546 }
547
540 // NativePanelTesting implementation. 548 // NativePanelTesting implementation.
541 class NativePanelTestingWin : public NativePanelTesting { 549 class NativePanelTestingWin : public NativePanelTesting {
542 public: 550 public:
543 explicit NativePanelTestingWin(PanelBrowserView* panel_browser_view); 551 explicit NativePanelTestingWin(PanelBrowserView* panel_browser_view);
544 552
545 private: 553 private:
546 virtual void PressLeftMouseButtonTitlebar( 554 virtual void PressLeftMouseButtonTitlebar(
547 const gfx::Point& mouse_location) OVERRIDE; 555 const gfx::Point& mouse_location) OVERRIDE;
548 virtual void ReleaseMouseButtonTitlebar() OVERRIDE; 556 virtual void ReleaseMouseButtonTitlebar() OVERRIDE;
549 virtual void DragTitlebar(const gfx::Point& mouse_location) OVERRIDE; 557 virtual void DragTitlebar(const gfx::Point& mouse_location) OVERRIDE;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 } 620 }
613 621
614 bool NativePanelTestingWin::IsWindowSizeKnown() const { 622 bool NativePanelTestingWin::IsWindowSizeKnown() const {
615 return true; 623 return true;
616 } 624 }
617 625
618 bool NativePanelTestingWin::IsAnimatingBounds() const { 626 bool NativePanelTestingWin::IsAnimatingBounds() const {
619 return panel_browser_view_->bounds_animator_.get() && 627 return panel_browser_view_->bounds_animator_.get() &&
620 panel_browser_view_->bounds_animator_->is_animating(); 628 panel_browser_view_->bounds_animator_->is_animating();
621 } 629 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698