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

Side by Side Diff: chrome/browser/ui/views/panels/panel_view.cc

Issue 1725883002: Add KeepAliveStateObserver, add the Restart option (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@KeepAlive
Patch Set: Created 4 years, 9 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 unified diff | Download patch
OLDNEW
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 "chrome/browser/ui/views/panels/panel_view.h" 5 #include "chrome/browser/ui/views/panels/panel_view.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <map> 8 #include <map>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 #endif 297 #endif
298 298
299 window_->Init(params); 299 window_->Init(params);
300 window_->set_frame_type(views::Widget::FRAME_TYPE_FORCE_CUSTOM); 300 window_->set_frame_type(views::Widget::FRAME_TYPE_FORCE_CUSTOM);
301 window_->set_focus_on_creation(false); 301 window_->set_focus_on_creation(false);
302 window_->AddObserver(this); 302 window_->AddObserver(this);
303 303
304 #if !defined(USE_ASH) 304 #if !defined(USE_ASH)
305 // Prevent the browser process from shutting down while this window is open. 305 // Prevent the browser process from shutting down while this window is open.
306 // Chrome OS already has a mechanism to always stay alive and skips this. 306 // Chrome OS already has a mechanism to always stay alive and skips this.
307 keep_alive_.reset(new ScopedKeepAlive(KeepAliveOrigin::PANEL_VIEW)); 307 keep_alive_.reset(new ScopedKeepAlive(KeepAliveOrigin::PANEL_VIEW,
308 KeepAliveRestartOption::DISABLED));
308 #endif // !defined(USE_ASH) 309 #endif // !defined(USE_ASH)
309 310
310 web_view_ = new views::WebView(NULL); 311 web_view_ = new views::WebView(NULL);
311 AddChildView(web_view_); 312 AddChildView(web_view_);
312 313
313 // Register accelarators supported by panels. 314 // Register accelarators supported by panels.
314 views::FocusManager* focus_manager = GetFocusManager(); 315 views::FocusManager* focus_manager = GetFocusManager();
315 const std::map<ui::Accelerator, int>& accelerator_table = 316 const std::map<ui::Accelerator, int>& accelerator_table =
316 GetAcceleratorTable(); 317 GetAcceleratorTable();
317 for (std::map<ui::Accelerator, int>::const_iterator iter = 318 for (std::map<ui::Accelerator, int>::const_iterator iter =
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 // SWP_FRAMECHANGED flag must be called in order for the cached window data 1148 // SWP_FRAMECHANGED flag must be called in order for the cached window data
1148 // to be updated properly. 1149 // to be updated properly.
1149 // http://msdn.microsoft.com/en-us/library/windows/desktop/ms633591(v=vs.85).a spx 1150 // http://msdn.microsoft.com/en-us/library/windows/desktop/ms633591(v=vs.85).a spx
1150 if (update_frame) { 1151 if (update_frame) {
1151 ::SetWindowPos(native_window, NULL, 0, 0, 0, 0, 1152 ::SetWindowPos(native_window, NULL, 0, 0, 0, 0,
1152 SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | 1153 SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE |
1153 SWP_NOZORDER | SWP_NOACTIVATE); 1154 SWP_NOZORDER | SWP_NOACTIVATE);
1154 } 1155 }
1155 } 1156 }
1156 #endif 1157 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698