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_list.h" | 11 #include "chrome/browser/ui/browser_list.h" |
11 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" | 12 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" |
12 #include "chrome/browser/ui/views/frame/browser_root_view.h" | 13 #include "chrome/browser/ui/views/frame/browser_root_view.h" |
13 #include "chrome/browser/ui/views/frame/browser_view.h" | 14 #include "chrome/browser/ui/views/frame/browser_view.h" |
14 #include "chrome/browser/ui/views/frame/native_browser_frame.h" | 15 #include "chrome/browser/ui/views/frame/native_browser_frame.h" |
15 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
16 #include "ui/base/theme_provider.h" | 17 #include "ui/base/theme_provider.h" |
17 #include "views/widget/native_widget.h" | 18 #include "views/widget/native_widget.h" |
18 | 19 |
19 #if defined(OS_WIN) | 20 #if defined(OS_WIN) |
(...skipping 16 matching lines...) Expand all Loading... |
36 | 37 |
37 BrowserFrame::~BrowserFrame() { | 38 BrowserFrame::~BrowserFrame() { |
38 } | 39 } |
39 | 40 |
40 void BrowserFrame::InitBrowserFrame() { | 41 void BrowserFrame::InitBrowserFrame() { |
41 native_browser_frame_ = | 42 native_browser_frame_ = |
42 NativeBrowserFrame::CreateNativeBrowserFrame(this, browser_view_); | 43 NativeBrowserFrame::CreateNativeBrowserFrame(this, browser_view_); |
43 views::Widget::InitParams params; | 44 views::Widget::InitParams params; |
44 params.delegate = browser_view_; | 45 params.delegate = browser_view_; |
45 params.native_widget = native_browser_frame_->AsNativeWidget(); | 46 params.native_widget = native_browser_frame_->AsNativeWidget(); |
| 47 if (browser_view_->browser()->is_type_tabbed()) { |
| 48 // Typed panel/popup can only return a size once the widget has been |
| 49 // created. |
| 50 params.bounds = browser_view_->browser()->GetSavedWindowBounds(); |
| 51 params.maximize = browser_view_->browser()->GetSavedMaximizedState(); |
| 52 } |
46 Init(params); | 53 Init(params); |
47 #if defined(OS_CHROMEOS) | 54 #if defined(OS_CHROMEOS) |
48 // On ChromeOS we always want top-level windows to appear active. | 55 // On ChromeOS we always want top-level windows to appear active. |
49 if (!browser_view_->IsBrowserTypePopup()) | 56 if (!browser_view_->IsBrowserTypePopup()) |
50 DisableInactiveRendering(); | 57 DisableInactiveRendering(); |
51 #endif | 58 #endif |
52 } | 59 } |
53 | 60 |
54 int BrowserFrame::GetMinimizeButtonOffset() const { | 61 int BrowserFrame::GetMinimizeButtonOffset() const { |
55 return native_browser_frame_->GetMinimizeButtonOffset(); | 62 return native_browser_frame_->GetMinimizeButtonOffset(); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 // When running under remote desktop, if the remote desktop client is not | 134 // When running under remote desktop, if the remote desktop client is not |
128 // active on the users desktop, then none of the windows contained in the | 135 // active on the users desktop, then none of the windows contained in the |
129 // remote desktop will be activated. However, NativeWidgetWin::Activate() | 136 // remote desktop will be activated. However, NativeWidgetWin::Activate() |
130 // will still bring this browser window to the foreground. We explicitly | 137 // will still bring this browser window to the foreground. We explicitly |
131 // set ourselves as the last active browser window to ensure that we get | 138 // set ourselves as the last active browser window to ensure that we get |
132 // treated as such by the rest of Chrome. | 139 // treated as such by the rest of Chrome. |
133 BrowserList::SetLastActive(browser_view_->browser()); | 140 BrowserList::SetLastActive(browser_view_->browser()); |
134 } | 141 } |
135 Widget::OnNativeWidgetActivationChanged(active); | 142 Widget::OnNativeWidgetActivationChanged(active); |
136 } | 143 } |
OLD | NEW |