| 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 "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 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 16 #include "chrome/app/chrome_command_ids.h" | 16 #include "chrome/app/chrome_command_ids.h" |
| 17 #include "chrome/browser/lifetime/scoped_keep_alive.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/ui/host_desktop.h" | 19 #include "chrome/browser/ui/host_desktop.h" |
| 19 #include "chrome/browser/ui/panels/panel.h" | 20 #include "chrome/browser/ui/panels/panel.h" |
| 20 #include "chrome/browser/ui/panels/panel_bounds_animation.h" | 21 #include "chrome/browser/ui/panels/panel_bounds_animation.h" |
| 21 #include "chrome/browser/ui/panels/panel_manager.h" | 22 #include "chrome/browser/ui/panels/panel_manager.h" |
| 22 #include "chrome/browser/ui/panels/stacked_panel_collection.h" | 23 #include "chrome/browser/ui/panels/stacked_panel_collection.h" |
| 23 #include "chrome/browser/ui/views/auto_keep_alive.h" | 24 #include "chrome/browser/ui/views/auto_keep_alive.h" |
| 24 #include "chrome/browser/ui/views/panels/panel_frame_view.h" | 25 #include "chrome/browser/ui/views/panels/panel_frame_view.h" |
| 25 #include "content/public/browser/render_view_host.h" | 26 #include "content/public/browser/render_view_host.h" |
| 26 #include "content/public/browser/render_widget_host_view.h" | 27 #include "content/public/browser/render_widget_host_view.h" |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 params.wm_class_name = web_app::GetWMClassFromAppName(panel->app_name()); | 295 params.wm_class_name = web_app::GetWMClassFromAppName(panel->app_name()); |
| 295 params.wm_class_class = shell_integration_linux::GetProgramClassName(); | 296 params.wm_class_class = shell_integration_linux::GetProgramClassName(); |
| 296 #endif | 297 #endif |
| 297 | 298 |
| 298 window_->Init(params); | 299 window_->Init(params); |
| 299 window_->set_frame_type(views::Widget::FRAME_TYPE_FORCE_CUSTOM); | 300 window_->set_frame_type(views::Widget::FRAME_TYPE_FORCE_CUSTOM); |
| 300 window_->set_focus_on_creation(false); | 301 window_->set_focus_on_creation(false); |
| 301 window_->AddObserver(this); | 302 window_->AddObserver(this); |
| 302 | 303 |
| 303 // Prevent the browser process from shutting down while this window is open. | 304 // Prevent the browser process from shutting down while this window is open. |
| 304 keep_alive_.reset(new AutoKeepAlive(GetNativePanelWindow())); | 305 keep_alive_ = AutoKeepAlive(GetNativePanelWindow()); |
| 305 | 306 |
| 306 web_view_ = new views::WebView(NULL); | 307 web_view_ = new views::WebView(NULL); |
| 307 AddChildView(web_view_); | 308 AddChildView(web_view_); |
| 308 | 309 |
| 309 // Register accelarators supported by panels. | 310 // Register accelarators supported by panels. |
| 310 views::FocusManager* focus_manager = GetFocusManager(); | 311 views::FocusManager* focus_manager = GetFocusManager(); |
| 311 const std::map<ui::Accelerator, int>& accelerator_table = | 312 const std::map<ui::Accelerator, int>& accelerator_table = |
| 312 GetAcceleratorTable(); | 313 GetAcceleratorTable(); |
| 313 for (std::map<ui::Accelerator, int>::const_iterator iter = | 314 for (std::map<ui::Accelerator, int>::const_iterator iter = |
| 314 accelerator_table.begin(); | 315 accelerator_table.begin(); |
| (...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1143 // SWP_FRAMECHANGED flag must be called in order for the cached window data | 1144 // SWP_FRAMECHANGED flag must be called in order for the cached window data |
| 1144 // to be updated properly. | 1145 // to be updated properly. |
| 1145 // http://msdn.microsoft.com/en-us/library/windows/desktop/ms633591(v=vs.85).a
spx | 1146 // http://msdn.microsoft.com/en-us/library/windows/desktop/ms633591(v=vs.85).a
spx |
| 1146 if (update_frame) { | 1147 if (update_frame) { |
| 1147 ::SetWindowPos(native_window, NULL, 0, 0, 0, 0, | 1148 ::SetWindowPos(native_window, NULL, 0, 0, 0, 0, |
| 1148 SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | | 1149 SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | |
| 1149 SWP_NOZORDER | SWP_NOACTIVATE); | 1150 SWP_NOZORDER | SWP_NOACTIVATE); |
| 1150 } | 1151 } |
| 1151 } | 1152 } |
| 1152 #endif | 1153 #endif |
| OLD | NEW |