| 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 #include "chrome/browser/ui/cocoa/extensions/extension_view_mac.h" | 5 #include "chrome/browser/ui/cocoa/extensions/extension_view_mac.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
| 10 #include "chrome/browser/extensions/extension_view_host.h" | 10 #include "chrome/browser/extensions/extension_view_host.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 ShowIfCompletelyLoaded(); | 86 ShowIfCompletelyLoaded(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 content::RenderViewHost* ExtensionViewMac::render_view_host() const { | 89 content::RenderViewHost* ExtensionViewMac::render_view_host() const { |
| 90 return extension_host_->render_view_host(); | 90 return extension_host_->render_view_host(); |
| 91 } | 91 } |
| 92 | 92 |
| 93 void ExtensionViewMac::ShowIfCompletelyLoaded() { | 93 void ExtensionViewMac::ShowIfCompletelyLoaded() { |
| 94 // We wait to show the ExtensionView until it has loaded, and the view has | 94 // We wait to show the ExtensionView until it has loaded, and the view has |
| 95 // actually been created. These can happen in different orders. | 95 // actually been created. These can happen in different orders. |
| 96 if (extension_host_->did_stop_loading()) { | 96 if (extension_host_->has_loaded_once()) { |
| 97 [GetNativeView() setHidden:NO]; | 97 [GetNativeView() setHidden:NO]; |
| 98 if (container_) | 98 if (container_) |
| 99 container_->OnExtensionViewDidShow(this); | 99 container_->OnExtensionViewDidShow(this); |
| 100 } | 100 } |
| 101 } | 101 } |
| 102 | 102 |
| 103 namespace extensions { | 103 namespace extensions { |
| 104 | 104 |
| 105 // static | 105 // static |
| 106 scoped_ptr<ExtensionView> ExtensionViewHost::CreateExtensionView( | 106 scoped_ptr<ExtensionView> ExtensionViewHost::CreateExtensionView( |
| 107 ExtensionViewHost* host, | 107 ExtensionViewHost* host, |
| 108 Browser* browser) { | 108 Browser* browser) { |
| 109 return make_scoped_ptr(new ExtensionViewMac(host, browser)); | 109 return make_scoped_ptr(new ExtensionViewMac(host, browser)); |
| 110 } | 110 } |
| 111 | 111 |
| 112 } // namespace extensions | 112 } // namespace extensions |
| OLD | NEW |