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

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

Issue 9428018: Create BaseWindow and ExtensionWindowWrapper for extension API access to Panels (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address comments. Created 8 years, 10 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
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_client.h" 10 #include "ui/aura/client/activation_client.h"
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 return window_->GetScreenBounds(); 408 return window_->GetScreenBounds();
409 } 409 }
410 410
411 gfx::Rect NativeWidgetAura::GetRestoredBounds() const { 411 gfx::Rect NativeWidgetAura::GetRestoredBounds() const {
412 gfx::Rect* restore_bounds = 412 gfx::Rect* restore_bounds =
413 window_->GetProperty(aura::client::kRestoreBoundsKey); 413 window_->GetProperty(aura::client::kRestoreBoundsKey);
414 return restore_bounds ? *restore_bounds : window_->bounds(); 414 return restore_bounds ? *restore_bounds : window_->bounds();
415 } 415 }
416 416
417 void NativeWidgetAura::SetBounds(const gfx::Rect& bounds) { 417 void NativeWidgetAura::SetBounds(const gfx::Rect& bounds) {
418 if (GetRestoreBounds(window_))
sky 2012/02/24 04:38:24 I don't think this makes sense here. Some layout m
stevenjb 2012/02/24 19:25:06 See http://codereview.chromium.org/9372126/
419 SetRestoreBounds(window_, bounds);
418 window_->SetBounds(bounds); 420 window_->SetBounds(bounds);
419 } 421 }
420 422
421 void NativeWidgetAura::SetSize(const gfx::Size& size) { 423 void NativeWidgetAura::SetSize(const gfx::Size& size) {
422 window_->SetBounds(gfx::Rect(window_->bounds().origin(), size)); 424 window_->SetBounds(gfx::Rect(window_->bounds().origin(), size));
423 } 425 }
424 426
425 void NativeWidgetAura::StackAbove(gfx::NativeView native_view) { 427 void NativeWidgetAura::StackAbove(gfx::NativeView native_view) {
426 if (window_->parent() && window_->parent() == native_view->parent()) 428 if (window_->parent() && window_->parent() == native_view->parent())
427 window_->parent()->StackChildAbove(window_, native_view); 429 window_->parent()->StackChildAbove(window_, native_view);
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 511
510 void NativeWidgetAura::SetAlwaysOnTop(bool on_top) { 512 void NativeWidgetAura::SetAlwaysOnTop(bool on_top) {
511 window_->SetProperty(aura::client::kAlwaysOnTopKey, on_top); 513 window_->SetProperty(aura::client::kAlwaysOnTopKey, on_top);
512 } 514 }
513 515
514 void NativeWidgetAura::Maximize() { 516 void NativeWidgetAura::Maximize() {
515 window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); 517 window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
516 } 518 }
517 519
518 void NativeWidgetAura::Minimize() { 520 void NativeWidgetAura::Minimize() {
519 // No minimized window for aura. crbug.com/104571. 521 // Note: This currently does not do anything except set the property,
520 NOTREACHED(); 522 // see crbug.com/104571.
523 window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED);
521 } 524 }
522 525
523 bool NativeWidgetAura::IsMaximized() const { 526 bool NativeWidgetAura::IsMaximized() const {
524 return window_->GetProperty(aura::client::kShowStateKey) == 527 return window_->GetProperty(aura::client::kShowStateKey) ==
525 ui::SHOW_STATE_MAXIMIZED; 528 ui::SHOW_STATE_MAXIMIZED;
526 } 529 }
527 530
528 bool NativeWidgetAura::IsMinimized() const { 531 bool NativeWidgetAura::IsMinimized() const {
529 return window_->GetProperty(aura::client::kShowStateKey) == 532 return window_->GetProperty(aura::client::kShowStateKey) ==
530 ui::SHOW_STATE_MINIMIZED; 533 ui::SHOW_STATE_MINIMIZED;
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 } 922 }
920 } 923 }
921 924
922 // static 925 // static
923 bool NativeWidgetPrivate::IsMouseButtonDown() { 926 bool NativeWidgetPrivate::IsMouseButtonDown() {
924 return aura::RootWindow::GetInstance()->IsMouseButtonDown(); 927 return aura::RootWindow::GetInstance()->IsMouseButtonDown();
925 } 928 }
926 929
927 } // namespace internal 930 } // namespace internal
928 } // namespace views 931 } // namespace views
OLDNEW
« chrome/browser/ui/views/aura/panel_view_aura.cc ('K') | « chrome/chrome_browser.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698