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

Unified Diff: views/window/window.cc

Issue 6976040: Revert 86914 - Move a bunch of functions from Window onto Widget. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/window/window.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/window/window.cc
===================================================================
--- views/window/window.cc (revision 86938)
+++ views/window/window.cc (working copy)
@@ -112,15 +112,80 @@
native_window_->SetWindowBounds(bounds, other_window);
}
+void Window::Show() {
+ native_window_->ShowNativeWindow(
+ saved_maximized_state_ ? NativeWindow::SHOW_MAXIMIZED
+ : NativeWindow::SHOW_RESTORED);
+ // |saved_maximized_state_| only applies the first time the window is shown.
+ // If we don't reset the value the window will be shown maximized every time
+ // it is subsequently shown after being hidden.
+ saved_maximized_state_ = false;
+}
+
void Window::ShowInactive() {
native_window_->ShowNativeWindow(NativeWindow::SHOW_INACTIVE);
}
+void Window::HideWindow() {
+ native_window_->HideWindow();
+}
+
void Window::DisableInactiveRendering() {
disable_inactive_rendering_ = true;
non_client_view_->DisableInactiveRendering(disable_inactive_rendering_);
}
+void Window::Activate() {
+ native_window_->Activate();
+}
+
+void Window::Deactivate() {
+ native_window_->Deactivate();
+}
+
+void Window::Close() {
+ if (window_closed_) {
+ // It appears we can hit this code path if you close a modal dialog then
+ // close the last browser before the destructor is hit, which triggers
+ // invoking Close again.
+ return;
+ }
+
+ if (non_client_view_->CanClose()) {
+ SaveWindowPosition();
+ Widget::Close();
+ window_closed_ = true;
+ }
+}
+
+void Window::Maximize() {
+ native_window_->Maximize();
+}
+
+void Window::Minimize() {
+ native_window_->Minimize();
+}
+
+void Window::Restore() {
+ native_window_->Restore();
+}
+
+bool Window::IsActive() const {
+ return native_window_->IsActive();
+}
+
+bool Window::IsVisible() const {
+ return native_window_->IsVisible();
+}
+
+bool Window::IsMaximized() const {
+ return native_window_->IsMaximized();
+}
+
+bool Window::IsMinimized() const {
+ return native_window_->IsMinimized();
+}
+
void Window::SetFullscreen(bool fullscreen) {
native_window_->SetFullscreen(fullscreen);
}
@@ -160,6 +225,10 @@
window_delegate_->GetWindowAppIcon());
}
+void Window::SetIsAlwaysOnTop(bool always_on_top) {
+ native_window_->SetAlwaysOnTop(always_on_top);
+}
+
NonClientFrameView* Window::CreateFrameViewForWindow() {
NonClientFrameView* frame_view = native_window_->CreateFrameViewForWindow();
return frame_view ? frame_view : new CustomFrameView(this);
@@ -169,6 +238,10 @@
native_window_->UpdateFrameAfterFrameChange();
}
+gfx::NativeWindow Window::GetNativeWindow() const {
+ return native_window_->GetNativeWindow();
+}
+
bool Window::ShouldUseNativeFrame() const {
if (frame_type_ != FRAME_TYPE_DEFAULT)
return frame_type_ == FRAME_TYPE_FORCE_NATIVE;
@@ -191,34 +264,6 @@
}
////////////////////////////////////////////////////////////////////////////////
-// Window, Widget overrides:
-
-void Window::Show() {
- native_window_->ShowNativeWindow(
- saved_maximized_state_ ? NativeWindow::SHOW_MAXIMIZED
- : NativeWindow::SHOW_RESTORED);
- // |saved_maximized_state_| only applies the first time the window is shown.
- // If we don't reset the value the window will be shown maximized every time
- // it is subsequently shown after being hidden.
- saved_maximized_state_ = false;
-}
-
-void Window::Close() {
- if (window_closed_) {
- // It appears we can hit this code path if you close a modal dialog then
- // close the last browser before the destructor is hit, which triggers
- // invoking Close again.
- return;
- }
-
- if (non_client_view_->CanClose()) {
- SaveWindowPosition();
- Widget::Close();
- window_closed_ = true;
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////
// Window, internal::NativeWindowDelegate implementation:
bool Window::CanActivate() const {
« no previous file with comments | « views/window/window.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698