| 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/frame/browser_frame.h" | 5 #include "chrome/browser/ui/views/frame/browser_frame.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/debug/leak_annotations.h" | 9 #include "base/debug/leak_annotations.h" |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // created. | 101 // created. |
| 102 chrome::GetSavedWindowBoundsAndShowState(browser_view_->browser(), | 102 chrome::GetSavedWindowBoundsAndShowState(browser_view_->browser(), |
| 103 ¶ms.bounds, | 103 ¶ms.bounds, |
| 104 ¶ms.show_state); | 104 ¶ms.show_state); |
| 105 } | 105 } |
| 106 #if defined(USE_ASH) | 106 #if defined(USE_ASH) |
| 107 if (browser_view_->browser()->host_desktop_type() == | 107 if (browser_view_->browser()->host_desktop_type() == |
| 108 chrome::HOST_DESKTOP_TYPE_ASH || chrome::ShouldOpenAshOnStartup()) { | 108 chrome::HOST_DESKTOP_TYPE_ASH || chrome::ShouldOpenAshOnStartup()) { |
| 109 params.context = ash::Shell::GetPrimaryRootWindow(); | 109 params.context = ash::Shell::GetPrimaryRootWindow(); |
| 110 #if defined(OS_WIN) | 110 #if defined(OS_WIN) |
| 111 // If this window is under ASH on Windows, we need it to be translucent. | 111 // If this window is under ASH on Windows, we need it to be translucent. |
| 112 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 112 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
| 113 #endif | 113 #endif |
| 114 } | 114 } |
| 115 #endif | 115 #endif |
| 116 | 116 |
| 117 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 117 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 118 // Set up a custom WM_CLASS for some sorts of window types. This allows | 118 // Set up a custom WM_CLASS for some sorts of window types. This allows |
| 119 // task switchers in X11 environments to distinguish between main browser | 119 // task switchers in X11 environments to distinguish between main browser |
| 120 // windows and e.g app windows. | 120 // windows and e.g app windows. |
| 121 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 121 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 122 const Browser& browser = *browser_view_->browser(); | 122 const Browser& browser = *browser_view_->browser(); |
| 123 params.wm_class_class = ShellIntegrationLinux::GetProgramClassName(); | 123 params.wm_class_class = shell_integration_linux::GetProgramClassName(); |
| 124 params.wm_class_name = params.wm_class_class; | 124 params.wm_class_name = params.wm_class_class; |
| 125 if (browser.is_app() && !browser.is_devtools()) { | 125 if (browser.is_app() && !browser.is_devtools()) { |
| 126 // This window is a hosted app or v1 packaged app. | 126 // This window is a hosted app or v1 packaged app. |
| 127 // NOTE: v2 packaged app windows are created by ChromeNativeAppWindowViews. | 127 // NOTE: v2 packaged app windows are created by ChromeNativeAppWindowViews. |
| 128 params.wm_class_name = web_app::GetWMClassFromAppName(browser.app_name()); | 128 params.wm_class_name = web_app::GetWMClassFromAppName(browser.app_name()); |
| 129 } else if (command_line.HasSwitch(switches::kUserDataDir)) { | 129 } else if (command_line.HasSwitch(switches::kUserDataDir)) { |
| 130 // Set the class name to e.g. "Chrome (/tmp/my-user-data)". The | 130 // Set the class name to e.g. "Chrome (/tmp/my-user-data)". The |
| 131 // class name will show up in the alt-tab list in gnome-shell if | 131 // class name will show up in the alt-tab list in gnome-shell if |
| 132 // you're running a binary that doesn't have a matching .desktop | 132 // you're running a binary that doesn't have a matching .desktop |
| 133 // file. | 133 // file. |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 bool BrowserFrame::ShouldLeaveOffsetNearTopBorder() { | 309 bool BrowserFrame::ShouldLeaveOffsetNearTopBorder() { |
| 310 return !IsMaximized(); | 310 return !IsMaximized(); |
| 311 } | 311 } |
| 312 | 312 |
| 313 void BrowserFrame::OnUseCustomChromeFrameChanged() { | 313 void BrowserFrame::OnUseCustomChromeFrameChanged() { |
| 314 // Tell the window manager to add or remove system borders. | 314 // Tell the window manager to add or remove system borders. |
| 315 set_frame_type(UseCustomFrame() ? Widget::FRAME_TYPE_FORCE_CUSTOM | 315 set_frame_type(UseCustomFrame() ? Widget::FRAME_TYPE_FORCE_CUSTOM |
| 316 : Widget::FRAME_TYPE_FORCE_NATIVE); | 316 : Widget::FRAME_TYPE_FORCE_NATIVE); |
| 317 FrameTypeChanged(); | 317 FrameTypeChanged(); |
| 318 } | 318 } |
| OLD | NEW |