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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 void Panel::SetBounds(const gfx::Rect& bounds) { | 86 void Panel::SetBounds(const gfx::Rect& bounds) { |
87 // Ignore any SetBounds requests since the bounds are completely controlled | 87 // Ignore any SetBounds requests since the bounds are completely controlled |
88 // by panel manager. | 88 // by panel manager. |
89 } | 89 } |
90 | 90 |
91 // Close() may be called multiple times if the browser window is not ready to | 91 // Close() may be called multiple times if the browser window is not ready to |
92 // close on the first attempt. | 92 // close on the first attempt. |
93 void Panel::Close() { | 93 void Panel::Close() { |
94 native_panel_->ClosePanel(); | 94 native_panel_->ClosePanel(); |
| 95 |
| 96 // TODO(dimich): Only implemented fully async on Mac. Need to update other |
| 97 // platforms. The panel should be removed from PanelManager when and if it |
| 98 // was actually closed. The closing can be cancelled because of onbeforeunload |
| 99 // handler on the web page. |
| 100 #if !defined(OS_MACOSX) |
95 manager()->Remove(this); | 101 manager()->Remove(this); |
| 102 #endif |
96 } | 103 } |
97 | 104 |
98 void Panel::Activate() { | 105 void Panel::Activate() { |
99 native_panel_->ActivatePanel(); | 106 native_panel_->ActivatePanel(); |
100 } | 107 } |
101 | 108 |
102 void Panel::Deactivate() { | 109 void Panel::Deactivate() { |
103 native_panel_->DeactivatePanel(); | 110 native_panel_->DeactivatePanel(); |
104 } | 111 } |
105 | 112 |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 } | 445 } |
439 #endif | 446 #endif |
440 | 447 |
441 Browser* Panel::browser() const { | 448 Browser* Panel::browser() const { |
442 return native_panel_->GetPanelBrowser(); | 449 return native_panel_->GetPanelBrowser(); |
443 } | 450 } |
444 | 451 |
445 void Panel::DestroyBrowser() { | 452 void Panel::DestroyBrowser() { |
446 native_panel_->DestroyPanelBrowser(); | 453 native_panel_->DestroyPanelBrowser(); |
447 } | 454 } |
OLD | NEW |