| 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 <map> | 7 #include <map> |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #if defined(OS_WIN) | 32 #if defined(OS_WIN) |
| 33 #include "base/win/windows_version.h" | 33 #include "base/win/windows_version.h" |
| 34 #include "chrome/browser/shell_integration.h" | 34 #include "chrome/browser/shell_integration.h" |
| 35 #include "chrome/browser/ui/views/panels/taskbar_window_thumbnailer_win.h" | 35 #include "chrome/browser/ui/views/panels/taskbar_window_thumbnailer_win.h" |
| 36 #include "ui/base/win/shell.h" | 36 #include "ui/base/win/shell.h" |
| 37 #include "ui/gfx/icon_util.h" | 37 #include "ui/gfx/icon_util.h" |
| 38 #include "ui/views/win/hwnd_util.h" | 38 #include "ui/views/win/hwnd_util.h" |
| 39 #endif | 39 #endif |
| 40 | 40 |
| 41 #if defined(USE_X11) && !defined(OS_CHROMEOS) | 41 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
| 42 #include "chrome/browser/shell_integration_linux.h" |
| 42 #include "chrome/browser/ui/views/panels/x11_panel_resizer.h" | 43 #include "chrome/browser/ui/views/panels/x11_panel_resizer.h" |
| 44 #include "chrome/browser/web_applications/web_app.h" |
| 43 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" | 45 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" |
| 44 #endif | 46 #endif |
| 45 | 47 |
| 46 namespace { | 48 namespace { |
| 47 | 49 |
| 48 #if defined(OS_WIN) | 50 #if defined(OS_WIN) |
| 49 // If the height of a stacked panel shrinks below this threshold during the | 51 // If the height of a stacked panel shrinks below this threshold during the |
| 50 // user resizing, it will be treated as minimized. | 52 // user resizing, it will be treated as minimized. |
| 51 const int kStackedPanelHeightShrinkThresholdToBecomeMinimized = | 53 const int kStackedPanelHeightShrinkThresholdToBecomeMinimized = |
| 52 panel::kTitlebarHeight + 20; | 54 panel::kTitlebarHeight + 20; |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 is_drawing_attention_(false), | 280 is_drawing_attention_(false), |
| 279 force_to_paint_as_inactive_(false), | 281 force_to_paint_as_inactive_(false), |
| 280 old_focused_view_(NULL) { | 282 old_focused_view_(NULL) { |
| 281 window_ = new views::Widget; | 283 window_ = new views::Widget; |
| 282 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); | 284 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); |
| 283 params.delegate = this; | 285 params.delegate = this; |
| 284 params.remove_standard_frame = true; | 286 params.remove_standard_frame = true; |
| 285 params.keep_on_top = always_on_top; | 287 params.keep_on_top = always_on_top; |
| 286 params.visible_on_all_workspaces = always_on_top; | 288 params.visible_on_all_workspaces = always_on_top; |
| 287 params.bounds = bounds; | 289 params.bounds = bounds; |
| 290 |
| 291 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
| 292 params.wm_class_name = web_app::GetWMClassFromAppName(panel->app_name()); |
| 293 params.wm_class_class = shell_integration_linux::GetProgramClassName(); |
| 294 #endif |
| 295 |
| 288 window_->Init(params); | 296 window_->Init(params); |
| 289 window_->set_frame_type(views::Widget::FRAME_TYPE_FORCE_CUSTOM); | 297 window_->set_frame_type(views::Widget::FRAME_TYPE_FORCE_CUSTOM); |
| 290 window_->set_focus_on_creation(false); | 298 window_->set_focus_on_creation(false); |
| 291 window_->AddObserver(this); | 299 window_->AddObserver(this); |
| 292 | 300 |
| 293 // Prevent the browser process from shutting down while this window is open. | 301 // Prevent the browser process from shutting down while this window is open. |
| 294 keep_alive_.reset(new AutoKeepAlive(GetNativePanelWindow())); | 302 keep_alive_.reset(new AutoKeepAlive(GetNativePanelWindow())); |
| 295 | 303 |
| 296 web_view_ = new views::WebView(NULL); | 304 web_view_ = new views::WebView(NULL); |
| 297 AddChildView(web_view_); | 305 AddChildView(web_view_); |
| (...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1144 // SWP_FRAMECHANGED flag must be called in order for the cached window data | 1152 // SWP_FRAMECHANGED flag must be called in order for the cached window data |
| 1145 // to be updated properly. | 1153 // to be updated properly. |
| 1146 // http://msdn.microsoft.com/en-us/library/windows/desktop/ms633591(v=vs.85).a
spx | 1154 // http://msdn.microsoft.com/en-us/library/windows/desktop/ms633591(v=vs.85).a
spx |
| 1147 if (update_frame) { | 1155 if (update_frame) { |
| 1148 ::SetWindowPos(native_window, NULL, 0, 0, 0, 0, | 1156 ::SetWindowPos(native_window, NULL, 0, 0, 0, 0, |
| 1149 SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | | 1157 SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | |
| 1150 SWP_NOZORDER | SWP_NOACTIVATE); | 1158 SWP_NOZORDER | SWP_NOACTIVATE); |
| 1151 } | 1159 } |
| 1152 } | 1160 } |
| 1153 #endif | 1161 #endif |
| OLD | NEW |