| 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 <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include "chrome/browser/ui/cocoa/extensions/extension_view_mac.h" | 7 #include "chrome/browser/ui/cocoa/extensions/extension_view_mac.h" |
| 8 | 8 |
| 9 #include "chrome/browser/extensions/extension_host.h" | 9 #include "chrome/browser/extensions/extension_host.h" |
| 10 #include "content/browser/tab_contents/web_contents_view_mac.h" | 10 #include "content/browser/tab_contents/web_contents_view_mac.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 } | 32 } |
| 33 | 33 |
| 34 void ExtensionViewMac::Init() { | 34 void ExtensionViewMac::Init() { |
| 35 CreateWidgetHostView(); | 35 CreateWidgetHostView(); |
| 36 } | 36 } |
| 37 | 37 |
| 38 gfx::NativeView ExtensionViewMac::native_view() { | 38 gfx::NativeView ExtensionViewMac::native_view() { |
| 39 return extension_host_->host_contents()->GetView()->GetNativeView(); | 39 return extension_host_->host_contents()->GetView()->GetNativeView(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 RenderViewHost* ExtensionViewMac::render_view_host() const { | 42 content::RenderViewHost* ExtensionViewMac::render_view_host() const { |
| 43 return extension_host_->render_view_host(); | 43 return extension_host_->render_view_host(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void ExtensionViewMac::DidStopLoading() { | 46 void ExtensionViewMac::DidStopLoading() { |
| 47 ShowIfCompletelyLoaded(); | 47 ShowIfCompletelyLoaded(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 void ExtensionViewMac::SetBackground(const SkBitmap& background) { | 50 void ExtensionViewMac::SetBackground(const SkBitmap& background) { |
| 51 if (!pending_background_.empty() && render_view_host()->GetView()) { | 51 if (!pending_background_.empty() && render_view_host()->GetView()) { |
| 52 render_view_host()->GetView()->SetBackground(background); | 52 render_view_host()->GetView()->SetBackground(background); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 void ExtensionViewMac::ShowIfCompletelyLoaded() { | 88 void ExtensionViewMac::ShowIfCompletelyLoaded() { |
| 89 // We wait to show the ExtensionView until it has loaded, and the view has | 89 // We wait to show the ExtensionView until it has loaded, and the view has |
| 90 // actually been created. These can happen in different orders. | 90 // actually been created. These can happen in different orders. |
| 91 if (extension_host_->did_stop_loading()) { | 91 if (extension_host_->did_stop_loading()) { |
| 92 [native_view() setHidden:NO]; | 92 [native_view() setHidden:NO]; |
| 93 if (container_) | 93 if (container_) |
| 94 container_->OnExtensionViewDidShow(this); | 94 container_->OnExtensionViewDidShow(this); |
| 95 } | 95 } |
| 96 } | 96 } |
| OLD | NEW |