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

Unified Diff: win8/metro_driver/chrome_app_view.cc

Issue 10964023: Don't attempt to delete and readd a duplicate hwnd in the SetFrameWindow notification in the metro … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: win8/metro_driver/chrome_app_view.cc
===================================================================
--- win8/metro_driver/chrome_app_view.cc (revision 157261)
+++ win8/metro_driver/chrome_app_view.cc (working copy)
@@ -218,15 +218,16 @@
::ShowWindow(current_top_frame, SW_HIDE);
}
- // If chrome opens a url in a foreground tab, it may call SetFrameWindow
- // again. Ensure that we don't have dups.
- globals.host_windows.remove_if([hwnd](std::pair<HWND, bool>& item) {
+ std::list<std::pair<HWND, bool> >::iterator index =
+ std::find_if(globals.host_windows.begin(), globals.host_windows.end(),
+ [hwnd](std::pair<HWND, bool>& item) {
return (item.first == hwnd);
});
- globals.host_windows.push_front(std::make_pair(hwnd, false));
-
- AdjustFrameWindowStyleForMetro(hwnd);
+ if (index == globals.host_windows.end()) {
+ globals.host_windows.push_front(std::make_pair(hwnd, false));
+ AdjustFrameWindowStyleForMetro(hwnd);
+ }
}
void CloseFrameWindowInternal(HWND hwnd) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698