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

Side by Side Diff: ui/views/widget/native_widget_aura.cc

Issue 10828133: Desktop Aura: Allow tab drags out of window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup Created 8 years, 4 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
« no previous file with comments | « ui/views/widget/native_widget_aura.h ('k') | ui/views/widget/native_widget_helper_aura.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/views/widget/native_widget_aura.h" 5 #include "ui/views/widget/native_widget_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "third_party/skia/include/core/SkRegion.h" 9 #include "third_party/skia/include/core/SkRegion.h"
10 #include "ui/aura/client/activation_change_observer.h" 10 #include "ui/aura/client/activation_change_observer.h"
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 #endif // !defined(OS_MACOSX) 226 #endif // !defined(OS_MACOSX)
227 227
228 drop_helper_.reset(new DropHelper(GetWidget()->GetRootView())); 228 drop_helper_.reset(new DropHelper(GetWidget()->GetRootView()));
229 if (params.type != Widget::InitParams::TYPE_TOOLTIP && 229 if (params.type != Widget::InitParams::TYPE_TOOLTIP &&
230 params.type != Widget::InitParams::TYPE_POPUP) { 230 params.type != Widget::InitParams::TYPE_POPUP) {
231 aura::client::SetDragDropDelegate(window_, this); 231 aura::client::SetDragDropDelegate(window_, this);
232 } 232 }
233 233
234 aura::client::SetActivationDelegate(window_, this); 234 aura::client::SetActivationDelegate(window_, this);
235 235
236 if (desktop_helper_.get()) { 236 if (desktop_helper_.get())
237 desktop_helper_->PostInitialize(); 237 desktop_helper_->PostInitialize();
238 // TODO(erg): Move this somewhere else?
239 desktop_helper_->ShowRootWindow();
240 }
241 } 238 }
242 239
243 NonClientFrameView* NativeWidgetAura::CreateNonClientFrameView() { 240 NonClientFrameView* NativeWidgetAura::CreateNonClientFrameView() {
244 return NULL; 241 return NULL;
245 } 242 }
246 243
247 void NativeWidgetAura::UpdateFrameAfterFrameChange() { 244 void NativeWidgetAura::UpdateFrameAfterFrameChange() {
248 } 245 }
249 246
250 bool NativeWidgetAura::ShouldUseNativeFrame() const { 247 bool NativeWidgetAura::ShouldUseNativeFrame() const {
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 return gfx::Screen::GetDisplayNearestWindow(GetNativeView()).work_area(); 654 return gfx::Screen::GetDisplayNearestWindow(GetNativeView()).work_area();
658 } 655 }
659 656
660 void NativeWidgetAura::SetInactiveRenderingDisabled(bool value) { 657 void NativeWidgetAura::SetInactiveRenderingDisabled(bool value) {
661 if (!value) 658 if (!value)
662 active_window_observer_.reset(); 659 active_window_observer_.reset();
663 else 660 else
664 active_window_observer_.reset(new ActiveWindowObserver(this)); 661 active_window_observer_.reset(new ActiveWindowObserver(this));
665 } 662 }
666 663
667 Widget::MoveLoopResult NativeWidgetAura::RunMoveLoop() { 664 Widget::MoveLoopResult NativeWidgetAura::RunMoveLoop(
665 const gfx::Point& drag_offset) {
668 if (window_->parent() && 666 if (window_->parent() &&
669 aura::client::GetWindowMoveClient(window_->parent())) { 667 aura::client::GetWindowMoveClient(window_->parent())) {
670 SetCapture(); 668 SetCapture();
671 aura::client::GetWindowMoveClient(window_->parent())->RunMoveLoop(window_); 669 aura::client::GetWindowMoveClient(window_->parent())->RunMoveLoop(
670 window_, drag_offset);
672 return Widget::MOVE_LOOP_SUCCESSFUL; 671 return Widget::MOVE_LOOP_SUCCESSFUL;
673 } 672 }
674 return Widget::MOVE_LOOP_CANCELED; 673 return Widget::MOVE_LOOP_CANCELED;
675 } 674 }
676 675
677 void NativeWidgetAura::EndMoveLoop() { 676 void NativeWidgetAura::EndMoveLoop() {
678 if (window_->parent() && 677 if (window_->parent() &&
679 aura::client::GetWindowMoveClient(window_->parent())) { 678 aura::client::GetWindowMoveClient(window_->parent())) {
680 aura::client::GetWindowMoveClient(window_->parent())->EndMoveLoop(); 679 aura::client::GetWindowMoveClient(window_->parent())->EndMoveLoop();
681 } 680 }
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
1044 return aura::Env::GetInstance()->is_mouse_button_down(); 1043 return aura::Env::GetInstance()->is_mouse_button_down();
1045 } 1044 }
1046 1045
1047 // static 1046 // static
1048 bool NativeWidgetPrivate::IsTouchDown() { 1047 bool NativeWidgetPrivate::IsTouchDown() {
1049 return aura::Env::GetInstance()->is_touch_down(); 1048 return aura::Env::GetInstance()->is_touch_down();
1050 } 1049 }
1051 1050
1052 } // namespace internal 1051 } // namespace internal
1053 } // namespace views 1052 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/native_widget_aura.h ('k') | ui/views/widget/native_widget_helper_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698