Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/widget.h" | 5 #include "ui/views/widget/widget.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 374 non_client_view_ = new NonClientView; | 374 non_client_view_ = new NonClientView; |
| 375 non_client_view_->SetFrameView(CreateNonClientFrameView()); | 375 non_client_view_->SetFrameView(CreateNonClientFrameView()); |
| 376 // Create the ClientView, add it to the NonClientView and add the | 376 // Create the ClientView, add it to the NonClientView and add the |
| 377 // NonClientView to the RootView. This will cause everything to be parented. | 377 // NonClientView to the RootView. This will cause everything to be parented. |
| 378 non_client_view_->set_client_view(widget_delegate_->CreateClientView(this)); | 378 non_client_view_->set_client_view(widget_delegate_->CreateClientView(this)); |
| 379 non_client_view_->SetOverlayView(widget_delegate_->CreateOverlayView()); | 379 non_client_view_->SetOverlayView(widget_delegate_->CreateOverlayView()); |
| 380 SetContentsView(non_client_view_); | 380 SetContentsView(non_client_view_); |
| 381 // Initialize the window's title before setting the window's initial bounds; | 381 // Initialize the window's title before setting the window's initial bounds; |
| 382 // the frame view's preferred height may depend on the presence of a title. | 382 // the frame view's preferred height may depend on the presence of a title. |
| 383 UpdateWindowTitle(); | 383 UpdateWindowTitle(); |
| 384 non_client_view_->ResetWindowControls(); | |
|
sky
2014/01/18 22:16:33
This is easy to break. How about a test?
Greg Billock
2014/01/21 19:54:32
Done. (and verified that without this line, the te
| |
| 384 SetInitialBounds(params.bounds); | 385 SetInitialBounds(params.bounds); |
| 385 if (params.show_state == ui::SHOW_STATE_MAXIMIZED) | 386 if (params.show_state == ui::SHOW_STATE_MAXIMIZED) |
| 386 Maximize(); | 387 Maximize(); |
| 387 else if (params.show_state == ui::SHOW_STATE_MINIMIZED) | 388 else if (params.show_state == ui::SHOW_STATE_MINIMIZED) |
| 388 Minimize(); | 389 Minimize(); |
| 389 } else if (params.delegate) { | 390 } else if (params.delegate) { |
| 390 SetContentsView(params.delegate->GetContentsView()); | 391 SetContentsView(params.delegate->GetContentsView()); |
| 391 SetInitialBoundsForFramelessWindow(params.bounds); | 392 SetInitialBoundsForFramelessWindow(params.bounds); |
| 392 } | 393 } |
| 393 native_widget_initialized_ = true; | 394 native_widget_initialized_ = true; |
| (...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1426 | 1427 |
| 1427 //////////////////////////////////////////////////////////////////////////////// | 1428 //////////////////////////////////////////////////////////////////////////////// |
| 1428 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1429 // internal::NativeWidgetPrivate, NativeWidget implementation: |
| 1429 | 1430 |
| 1430 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1431 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
| 1431 return this; | 1432 return this; |
| 1432 } | 1433 } |
| 1433 | 1434 |
| 1434 } // namespace internal | 1435 } // namespace internal |
| 1435 } // namespace views | 1436 } // namespace views |
| OLD | NEW |