| 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/panels/panel.h" | 5 #include "chrome/browser/ui/panels/panel.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/extensions/extension_prefs.h" | 8 #include "chrome/browser/extensions/extension_prefs.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 } | 165 } |
| 166 | 166 |
| 167 // Close() may be called multiple times if the browser window is not ready to | 167 // Close() may be called multiple times if the browser window is not ready to |
| 168 // close on the first attempt. | 168 // close on the first attempt. |
| 169 void Panel::Close() { | 169 void Panel::Close() { |
| 170 native_panel_->ClosePanel(); | 170 native_panel_->ClosePanel(); |
| 171 | 171 |
| 172 // TODO(dimich): Only implemented fully async on Mac. Need to update other | 172 // TODO(dimich): Only implemented fully async on Mac. Need to update other |
| 173 // platforms. The panel should be removed from PanelManager when and if it | 173 // platforms. The panel should be removed from PanelManager when and if it |
| 174 // was actually closed. The closing can be cancelled because of onbeforeunload | 174 // was actually closed. The closing can be cancelled because of onbeforeunload |
| 175 // handler on the web page. | 175 // handler on the web page. http://crbug.com/102720 |
| 176 #if !defined(OS_MACOSX) | 176 #if !defined(OS_MACOSX) |
| 177 manager()->Remove(this); | 177 manager()->Remove(this); |
| 178 #endif | 178 #endif |
| 179 } | 179 } |
| 180 | 180 |
| 181 void Panel::Activate() { | 181 void Panel::Activate() { |
| 182 // Make sure the panel is expanded when activated programmatically, | 182 // Make sure the panel is expanded when activated programmatically, |
| 183 // so the user input does not go into collapsed window. | 183 // so the user input does not go into collapsed window. |
| 184 SetExpansionState(Panel::EXPANDED); | 184 SetExpansionState(Panel::EXPANDED); |
| 185 native_panel_->ActivatePanel(); | 185 native_panel_->ActivatePanel(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 200 gfx::NativeWindow Panel::GetNativeHandle() { | 200 gfx::NativeWindow Panel::GetNativeHandle() { |
| 201 return native_panel_->GetNativePanelHandle(); | 201 return native_panel_->GetNativePanelHandle(); |
| 202 } | 202 } |
| 203 | 203 |
| 204 BrowserWindowTesting* Panel::GetBrowserWindowTesting() { | 204 BrowserWindowTesting* Panel::GetBrowserWindowTesting() { |
| 205 NOTIMPLEMENTED(); | 205 NOTIMPLEMENTED(); |
| 206 return NULL; | 206 return NULL; |
| 207 } | 207 } |
| 208 | 208 |
| 209 StatusBubble* Panel::GetStatusBubble() { | 209 StatusBubble* Panel::GetStatusBubble() { |
| 210 // TODO(jennb): Implement. | 210 // TODO(jennb): Implement. http://crbug.com/102723 |
| 211 return NULL; | 211 return NULL; |
| 212 } | 212 } |
| 213 | 213 |
| 214 void Panel::ToolbarSizeChanged(bool is_animating){ | 214 void Panel::ToolbarSizeChanged(bool is_animating){ |
| 215 NOTIMPLEMENTED(); | 215 NOTIMPLEMENTED(); |
| 216 } | 216 } |
| 217 | 217 |
| 218 void Panel::UpdateTitleBar() { | 218 void Panel::UpdateTitleBar() { |
| 219 native_panel_->UpdatePanelTitleBar(); | 219 native_panel_->UpdatePanelTitleBar(); |
| 220 } | 220 } |
| 221 | 221 |
| 222 void Panel::BookmarkBarStateChanged( | 222 void Panel::BookmarkBarStateChanged( |
| 223 BookmarkBar::AnimateChangeType change_type) { | 223 BookmarkBar::AnimateChangeType change_type) { |
| 224 NOTIMPLEMENTED(); | 224 NOTIMPLEMENTED(); |
| 225 } | 225 } |
| 226 | 226 |
| 227 void Panel::UpdateDevTools() { | 227 void Panel::UpdateDevTools() { |
| 228 NOTIMPLEMENTED(); | 228 NOTIMPLEMENTED(); |
| 229 } | 229 } |
| 230 | 230 |
| 231 void Panel::UpdateLoadingAnimations(bool should_animate) { | 231 void Panel::UpdateLoadingAnimations(bool should_animate) { |
| 232 native_panel_->UpdatePanelLoadingAnimations(should_animate); | 232 native_panel_->UpdatePanelLoadingAnimations(should_animate); |
| 233 } | 233 } |
| 234 | 234 |
| 235 void Panel::SetStarredState(bool is_starred) { | 235 void Panel::SetStarredState(bool is_starred) { |
| 236 // TODO(jennb): Figure out if this applies to Panels. | 236 // Since panels are typically not bookmarked extension UI windows, they don't |
| 237 // have starred state. |
| 237 } | 238 } |
| 238 | 239 |
| 239 gfx::Rect Panel::GetRestoredBounds() const { | 240 gfx::Rect Panel::GetRestoredBounds() const { |
| 240 gfx::Rect bounds = native_panel_->GetPanelBounds(); | 241 gfx::Rect bounds = native_panel_->GetPanelBounds(); |
| 241 bounds.set_y(bounds.y() + bounds.height() - restored_height_); | 242 bounds.set_y(bounds.y() + bounds.height() - restored_height_); |
| 242 bounds.set_height(restored_height_); | 243 bounds.set_height(restored_height_); |
| 243 return bounds; | 244 return bounds; |
| 244 } | 245 } |
| 245 | 246 |
| 246 gfx::Rect Panel::GetBounds() const { | 247 gfx::Rect Panel::GetBounds() const { |
| 247 return native_panel_->GetPanelBounds(); | 248 return native_panel_->GetPanelBounds(); |
| 248 } | 249 } |
| 249 | 250 |
| 250 bool Panel::IsMaximized() const { | 251 bool Panel::IsMaximized() const { |
| 251 // TODO(jennb): Figure out how this applies to Panels. Means isZoomed. | 252 // Size of panels is managed by PanelManager, they are never 'zoomed'. |
| 252 return false; | 253 return false; |
| 253 } | 254 } |
| 254 | 255 |
| 255 bool Panel::IsMinimized() const { | 256 bool Panel::IsMinimized() const { |
| 256 return expansion_state_ != EXPANDED; | 257 return expansion_state_ != EXPANDED; |
| 257 } | 258 } |
| 258 | 259 |
| 259 void Panel::EnterFullscreen( | 260 void Panel::EnterFullscreen( |
| 260 const GURL& url, FullscreenExitBubbleType type) { | 261 const GURL& url, FullscreenExitBubbleType type) { |
| 261 NOTIMPLEMENTED(); | 262 NOTIMPLEMENTED(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 283 LocationBar* Panel::GetLocationBar() const { | 284 LocationBar* Panel::GetLocationBar() const { |
| 284 // Panels do not have a location bar. | 285 // Panels do not have a location bar. |
| 285 return NULL; | 286 return NULL; |
| 286 } | 287 } |
| 287 | 288 |
| 288 void Panel::SetFocusToLocationBar(bool select_all) { | 289 void Panel::SetFocusToLocationBar(bool select_all) { |
| 289 // Panels do not have a location bar. | 290 // Panels do not have a location bar. |
| 290 } | 291 } |
| 291 | 292 |
| 292 void Panel::UpdateReloadStopState(bool is_loading, bool force) { | 293 void Panel::UpdateReloadStopState(bool is_loading, bool force) { |
| 293 // TODO(jennb): Implement. | 294 // Panels don't have stop/reload indicator. |
| 294 } | 295 } |
| 295 | 296 |
| 296 void Panel::UpdateToolbar(TabContentsWrapper* contents, | 297 void Panel::UpdateToolbar(TabContentsWrapper* contents, |
| 297 bool should_restore_state) { | 298 bool should_restore_state) { |
| 298 // Panels do not have a toolbar. | 299 // Panels do not have a toolbar. |
| 299 } | 300 } |
| 300 | 301 |
| 301 void Panel::FocusToolbar() { | 302 void Panel::FocusToolbar() { |
| 302 // Panels do not have a toolbar. | 303 // Panels do not have a toolbar. |
| 303 } | 304 } |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 RequestRenderViewHostToDisableScrollbars(GetRenderViewHost()); | 591 RequestRenderViewHostToDisableScrollbars(GetRenderViewHost()); |
| 591 } | 592 } |
| 592 | 593 |
| 593 Browser* Panel::browser() const { | 594 Browser* Panel::browser() const { |
| 594 return native_panel_->GetPanelBrowser(); | 595 return native_panel_->GetPanelBrowser(); |
| 595 } | 596 } |
| 596 | 597 |
| 597 void Panel::DestroyBrowser() { | 598 void Panel::DestroyBrowser() { |
| 598 native_panel_->DestroyPanelBrowser(); | 599 native_panel_->DestroyPanelBrowser(); |
| 599 } | 600 } |
| OLD | NEW |