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/intents/web_intent_extension_prompt_view_contro
ller.h" | 5 #import "chrome/browser/ui/cocoa/intents/web_intent_extension_prompt_view_contro
ller.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #import "chrome/browser/ui/cocoa/extensions/extension_install_view_controller.h" | 9 #import "chrome/browser/ui/cocoa/extensions/extension_install_view_controller.h" |
10 #import "chrome/browser/ui/cocoa/flipped_view.h" | 10 #import "chrome/browser/ui/cocoa/flipped_view.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 if (viewController_.get()) | 26 if (viewController_.get()) |
27 return; | 27 return; |
28 | 28 |
29 viewController_.reset([[ExtensionInstallViewController alloc] | 29 viewController_.reset([[ExtensionInstallViewController alloc] |
30 initWithNavigator:navigator | 30 initWithNavigator:navigator |
31 delegate:delegate | 31 delegate:delegate |
32 prompt:prompt]); | 32 prompt:prompt]); |
33 [[self view] addSubview:[viewController_ view]]; | 33 [[self view] addSubview:[viewController_ view]]; |
34 } | 34 } |
35 | 35 |
36 - (void)clear { | |
37 [[viewController_ view] removeFromSuperview]; | |
38 viewController_.reset(); | |
39 } | |
40 | |
41 - (ExtensionInstallViewController*)viewController { | 36 - (ExtensionInstallViewController*)viewController { |
42 return viewController_; | 37 return viewController_; |
43 } | 38 } |
44 | 39 |
45 - (void)sizeToFitAndLayout { | 40 - (void)sizeToFitAndLayout { |
46 if (!viewController_) { | 41 if (!viewController_) { |
47 [[self view] setFrameSize:NSZeroSize]; | 42 [[self view] setFrameSize:NSZeroSize]; |
48 return; | 43 return; |
49 } | 44 } |
50 | 45 |
51 NSSize size = [[viewController_ view] bounds].size; | 46 NSSize size = [[viewController_ view] bounds].size; |
52 [[self view] setFrameSize:size]; | 47 [[self view] setFrameSize:size]; |
53 [[viewController_ view] setFrameOrigin:NSZeroPoint]; | 48 [[viewController_ view] setFrameOrigin:NSZeroPoint]; |
54 } | 49 } |
55 | 50 |
| 51 - (void)viewRemovedFromSuperview { |
| 52 [[viewController_ view] removeFromSuperview]; |
| 53 viewController_.reset(); |
| 54 } |
| 55 |
56 @end | 56 @end |
OLD | NEW |