summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-12 18:02:56 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-12 18:02:56 +0000
commit8bd4316e5b029c20ef5e7ae0878285abe1f4b873 (patch)
tree3a9b65b604859f50c4364a3d8cc8d331d76f6bfc /chrome/browser/autocomplete
parente89516efa002279a2da15699046fd9a8f0647c7e (diff)
downloadchromium_src-8bd4316e5b029c20ef5e7ae0878285abe1f4b873.zip
chromium_src-8bd4316e5b029c20ef5e7ae0878285abe1f4b873.tar.gz
chromium_src-8bd4316e5b029c20ef5e7ae0878285abe1f4b873.tar.bz2
Make toggling fullscreen mode on/off significantly less janky-looking by means of various crazy hacks.
Review URL: http://codereview.chromium.org/42106 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11550 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete')
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_win.cc7
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_win.h10
2 files changed, 17 insertions, 0 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
index a25845d..6b9c254 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
@@ -406,6 +406,7 @@ AutocompleteEditViewWin::AutocompleteEditViewWin(
toolbar_model_(toolbar_model),
command_updater_(command_updater),
popup_window_mode_(popup_window_mode),
+ force_hidden_(false),
tracking_click_(false),
tracking_double_click_(false),
double_click_time_(0),
@@ -1578,6 +1579,12 @@ void AutocompleteEditViewWin::OnSysChar(TCHAR ch,
SetMsgHandled(false);
}
+void AutocompleteEditViewWin::OnWindowPosChanging(WINDOWPOS* window_pos) {
+ if (force_hidden_)
+ window_pos->flags &= ~SWP_SHOWWINDOW;
+ SetMsgHandled(true);
+}
+
void AutocompleteEditViewWin::HandleKeystroke(UINT message,
TCHAR key,
UINT repeat_count,
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.h b/chrome/browser/autocomplete/autocomplete_edit_view_win.h
index 9905f1c..e4c1b02 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_win.h
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.h
@@ -133,6 +133,8 @@ class AutocompleteEditViewWin
// typed in the specified text and pressed enter.
void PasteAndGo(const std::wstring& text);
+ void set_force_hidden(bool force_hidden) { force_hidden_ = force_hidden; }
+
// Called before an accelerator is processed to give us a chance to override
// it.
bool OverrideAccelerator(const views::Accelerator& accelerator);
@@ -167,6 +169,7 @@ class AutocompleteEditViewWin
MSG_WM_SYSCHAR(OnSysChar) // WM_SYSxxx == WM_xxx with ALT down
MSG_WM_SYSKEYDOWN(OnKeyDown)
MSG_WM_SYSKEYUP(OnKeyUp)
+ MSG_WM_WINDOWPOSCHANGING(OnWindowPosChanging)
DEFAULT_REFLECTION_HANDLER() // avoids black margin area
END_MSG_MAP()
@@ -241,6 +244,7 @@ class AutocompleteEditViewWin
void OnPaste();
void OnSetFocus(HWND focus_wnd);
void OnSysChar(TCHAR ch, UINT repeat_count, UINT flags);
+ void OnWindowPosChanging(WINDOWPOS* window_pos);
// Helper function for OnChar() and OnKeyDown() that handles keystrokes that
// could change the text in the edit.
@@ -365,6 +369,12 @@ class AutocompleteEditViewWin
// different presentation (font size / color). This is used for popups.
bool popup_window_mode_;
+ // True if we should prevent attempts to make the window visible when we
+ // handle WM_WINDOWPOSCHANGING. While toggling fullscreen mode, the main
+ // window is hidden, and if the edit is shown it will draw over the main
+ // window when that window reappears.
+ bool force_hidden_;
+
// Non-null when the edit is gaining focus from a left click. This is only
// needed between when WM_MOUSEACTIVATE and WM_LBUTTONDOWN get processed. It
// serves two purposes: first, by communicating to OnLButtonDown() that we're