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/chromeos/frame/panel_browser_view.h" | 5 #include "chrome/browser/chromeos/frame/panel_browser_view.h" |
6 | 6 |
7 #include "chrome/browser/chromeos/frame/browser_view.h" | 7 #include "chrome/browser/chromeos/frame/browser_view.h" |
8 #include "chrome/browser/chromeos/frame/panel_controller.h" | 8 #include "chrome/browser/chromeos/frame/panel_controller.h" |
9 #include "third_party/cros_system_api/window_manager/chromeos_wm_ipc_enums.h" | 9 #include "third_party/cros_system_api/window_manager/chromeos_wm_ipc_enums.h" |
10 #include "views/widget/widget.h" | 10 #include "views/widget/widget.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 DCHECK(creator); | 103 DCHECK(creator); |
104 GtkWindow* window = creator->GetNativeHandle(); | 104 GtkWindow* window = creator->GetNativeHandle(); |
105 creator_xid_ = ui::GetX11WindowFromGtkWidget(GTK_WIDGET(window)); | 105 creator_xid_ = ui::GetX11WindowFromGtkWidget(GTK_WIDGET(window)); |
106 } | 106 } |
107 | 107 |
108 WindowOpenDisposition PanelBrowserView::GetDispositionForPopupBounds( | 108 WindowOpenDisposition PanelBrowserView::GetDispositionForPopupBounds( |
109 const gfx::Rect& bounds) { | 109 const gfx::Rect& bounds) { |
110 return chromeos::BrowserView::DispositionForPopupBounds(bounds); | 110 return chromeos::BrowserView::DispositionForPopupBounds(bounds); |
111 } | 111 } |
112 | 112 |
113 bool PanelBrowserView::GetSavedWindowPlacement( | 113 bool PanelBrowserView::GetSavedWindowBounds(gfx::Rect* bounds) const { |
114 gfx::Rect* bounds, | 114 bool res = ::BrowserView::GetSavedWindowBounds(bounds); |
115 ui::WindowShowState* show_state) const { | 115 if (res) |
116 bool result = ::BrowserView::GetSavedWindowPlacement(bounds, show_state); | |
117 if (result) { | |
118 LimitBounds(bounds); | 116 LimitBounds(bounds); |
119 // Panels have no maximized state. | 117 return res; |
120 *show_state = ui::SHOW_STATE_NORMAL; | 118 } |
121 } | 119 |
122 return result; | 120 bool PanelBrowserView::GetSavedMaximizedState(bool* maximized) const { |
| 121 // Panels have no maximized state. |
| 122 return false; |
123 } | 123 } |
124 | 124 |
125 //////////////////////////////////////////////////////////////////////////////// | 125 //////////////////////////////////////////////////////////////////////////////// |
126 // views::Widget::Observer overrides. | 126 // views::Widget::Observer overrides. |
127 | 127 |
128 void PanelBrowserView::OnWidgetActivationChanged(views::Widget* widget, | 128 void PanelBrowserView::OnWidgetActivationChanged(views::Widget* widget, |
129 bool active) { | 129 bool active) { |
130 ::BrowserView::OnWidgetActivationChanged(widget, active); | 130 ::BrowserView::OnWidgetActivationChanged(widget, active); |
131 if (panel_controller_.get()) { | 131 if (panel_controller_.get()) { |
132 if (active) | 132 if (active) |
(...skipping 30 matching lines...) Expand all Loading... |
163 | 163 |
164 void PanelBrowserView::ClosePanel() { | 164 void PanelBrowserView::ClosePanel() { |
165 Close(); | 165 Close(); |
166 } | 166 } |
167 | 167 |
168 void PanelBrowserView::ActivatePanel() { | 168 void PanelBrowserView::ActivatePanel() { |
169 Activate(); | 169 Activate(); |
170 } | 170 } |
171 | 171 |
172 } // namespace chromeos | 172 } // namespace chromeos |
OLD | NEW |