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

Unified Diff: views/window/window.cc

Issue 7036014: Consolidate ShouldUseNativeFrame/AlwaysUseNativeFrame/UseNativeFrame spaghetti. (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') | views/window/window_win.cc » ('j') | 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 85647)
+++ views/window/window.cc (working copy)
@@ -37,7 +37,8 @@
saved_maximized_state_(false),
minimum_size_(100, 100),
disable_inactive_rendering_(false),
- window_closed_(false) {
+ window_closed_(false),
+ frame_type_(FRAME_TYPE_DEFAULT) {
}
Window::~Window() {
@@ -238,9 +239,22 @@
}
bool Window::ShouldUseNativeFrame() const {
+ if (frame_type_ != FRAME_TYPE_DEFAULT)
+ return frame_type_ == FRAME_TYPE_FORCE_NATIVE;
return native_window_->ShouldUseNativeFrame();
}
+void Window::DebugToggleFrameType() {
+ if (frame_type_ == FRAME_TYPE_DEFAULT) {
+ frame_type_ = ShouldUseNativeFrame() ? FRAME_TYPE_FORCE_CUSTOM :
+ FRAME_TYPE_FORCE_NATIVE;
+ } else {
+ frame_type_ = frame_type_ == FRAME_TYPE_FORCE_CUSTOM ?
+ FRAME_TYPE_FORCE_NATIVE : FRAME_TYPE_FORCE_CUSTOM;
+ }
+ FrameTypeChanged();
+}
+
void Window::FrameTypeChanged() {
native_window_->FrameTypeChanged();
}
@@ -269,10 +283,6 @@
return !!window_delegate_->AsDialogDelegate();
}
-bool Window::IsUsingNativeFrame() const {
- return non_client_view_->UseNativeFrame();
-}
-
gfx::Size Window::GetMinimumSize() const {
return non_client_view_->GetMinimumSize();
}
« no previous file with comments | « views/window/window.h ('k') | views/window/window_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698