OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #import "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h" | 5 #import "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "chrome/browser/devtools/devtools_window.h" | 9 #include "chrome/browser/devtools/devtools_window.h" |
10 #include "chrome/browser/extensions/extension_host.h" | 10 #include "chrome/browser/extensions/extension_host.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 | 194 |
195 - (void)showDevTools { | 195 - (void)showDevTools { |
196 DevToolsWindow::OpenDevToolsWindow(host_->render_view_host()); | 196 DevToolsWindow::OpenDevToolsWindow(host_->render_view_host()); |
197 } | 197 } |
198 | 198 |
199 - (void)windowWillClose:(NSNotification *)notification { | 199 - (void)windowWillClose:(NSNotification *)notification { |
200 [super windowWillClose:notification]; | 200 [super windowWillClose:notification]; |
201 gPopup = nil; | 201 gPopup = nil; |
202 if (host_->view()) | 202 if (host_->view()) |
203 host_->view()->set_container(NULL); | 203 host_->view()->set_container(NULL); |
| 204 host_.reset(); |
204 } | 205 } |
205 | 206 |
206 - (void)windowDidResignKey:(NSNotification*)notification { | 207 - (void)windowDidResignKey:(NSNotification*)notification { |
207 if (!beingInspected_) | 208 if (!beingInspected_) |
208 [super windowDidResignKey:notification]; | 209 [super windowDidResignKey:notification]; |
209 } | 210 } |
210 | 211 |
211 - (BOOL)isClosing { | 212 - (BOOL)isClosing { |
212 return [static_cast<InfoBubbleWindow*>([self window]) isClosing]; | 213 return [static_cast<InfoBubbleWindow*>([self window]) isClosing]; |
213 } | 214 } |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 return minSize; | 373 return minSize; |
373 } | 374 } |
374 | 375 |
375 // Private (TestingAPI) | 376 // Private (TestingAPI) |
376 + (NSSize)maxPopupSize { | 377 + (NSSize)maxPopupSize { |
377 NSSize maxSize = {ExtensionViewMac::kMaxWidth, ExtensionViewMac::kMaxHeight}; | 378 NSSize maxSize = {ExtensionViewMac::kMaxWidth, ExtensionViewMac::kMaxHeight}; |
378 return maxSize; | 379 return maxSize; |
379 } | 380 } |
380 | 381 |
381 @end | 382 @end |
OLD | NEW |