OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/themes/theme_service.h" | 8 #include "chrome/browser/themes/theme_service.h" |
9 #include "chrome/browser/themes/theme_service_factory.h" | 9 #include "chrome/browser/themes/theme_service_factory.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 NativeBrowserFrame::CreateNativeBrowserFrame(this, browser_view_); | 43 NativeBrowserFrame::CreateNativeBrowserFrame(this, browser_view_); |
44 views::Widget::InitParams params; | 44 views::Widget::InitParams params; |
45 params.delegate = browser_view_; | 45 params.delegate = browser_view_; |
46 params.native_widget = native_browser_frame_->AsNativeWidget(); | 46 params.native_widget = native_browser_frame_->AsNativeWidget(); |
47 if (browser_view_->browser()->is_type_tabbed()) { | 47 if (browser_view_->browser()->is_type_tabbed()) { |
48 // Typed panel/popup can only return a size once the widget has been | 48 // Typed panel/popup can only return a size once the widget has been |
49 // created. | 49 // created. |
50 params.bounds = browser_view_->browser()->GetSavedWindowBounds(); | 50 params.bounds = browser_view_->browser()->GetSavedWindowBounds(); |
51 params.show_state = browser_view_->browser()->GetSavedWindowShowState(); | 51 params.show_state = browser_view_->browser()->GetSavedWindowShowState(); |
52 } | 52 } |
| 53 if (browser_view_->browser()->is_type_panel()) { |
| 54 // We need to set the top-most bit when the panel window is created. |
| 55 // There is a Windows bug/feature that would very likely prevent the window |
| 56 // from being changed to top-most after the window is created without |
| 57 // activation. |
| 58 params.keep_on_top = true; |
| 59 } |
53 Init(params); | 60 Init(params); |
54 #if defined(OS_CHROMEOS) | 61 #if defined(OS_CHROMEOS) |
55 // On ChromeOS we always want top-level windows to appear active. | 62 // On ChromeOS we always want top-level windows to appear active. |
56 if (!browser_view_->IsBrowserTypePopup()) | 63 if (!browser_view_->IsBrowserTypePopup()) |
57 DisableInactiveRendering(); | 64 DisableInactiveRendering(); |
58 #endif | 65 #endif |
59 } | 66 } |
60 | 67 |
61 int BrowserFrame::GetMinimizeButtonOffset() const { | 68 int BrowserFrame::GetMinimizeButtonOffset() const { |
62 return native_browser_frame_->GetMinimizeButtonOffset(); | 69 return native_browser_frame_->GetMinimizeButtonOffset(); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 // When running under remote desktop, if the remote desktop client is not | 141 // When running under remote desktop, if the remote desktop client is not |
135 // active on the users desktop, then none of the windows contained in the | 142 // active on the users desktop, then none of the windows contained in the |
136 // remote desktop will be activated. However, NativeWidgetWin::Activate() | 143 // remote desktop will be activated. However, NativeWidgetWin::Activate() |
137 // will still bring this browser window to the foreground. We explicitly | 144 // will still bring this browser window to the foreground. We explicitly |
138 // set ourselves as the last active browser window to ensure that we get | 145 // set ourselves as the last active browser window to ensure that we get |
139 // treated as such by the rest of Chrome. | 146 // treated as such by the rest of Chrome. |
140 BrowserList::SetLastActive(browser_view_->browser()); | 147 BrowserList::SetLastActive(browser_view_->browser()); |
141 } | 148 } |
142 Widget::OnNativeWidgetActivationChanged(active); | 149 Widget::OnNativeWidgetActivationChanged(active); |
143 } | 150 } |
OLD | NEW |