- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / cocoa / extensions / extension_installed_bubble_bridge.mm
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
3 // found in the LICENSE file.
4
5 #import <Cocoa/Cocoa.h>
6
7 #include "chrome/browser/extensions/bundle_installer.h"
8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/browser_window.h"
10 #import "chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.h"
11 #include "chrome/common/extensions/extension.h"
12 #include "third_party/skia/include/core/SkBitmap.h"
13
14 using extensions::BundleInstaller;
15
16 namespace chrome {
17
18 void ShowExtensionInstalledBubble(const extensions::Extension* extension,
19                                   Browser* browser,
20                                   const SkBitmap& icon) {
21   // The controller is deallocated when the window is closed, so no need to
22   // worry about it here.
23   [[ExtensionInstalledBubbleController alloc]
24       initWithParentWindow:browser->window()->GetNativeWindow()
25                  extension:extension
26                     bundle:NULL
27                    browser:browser
28                       icon:icon];
29 }
30
31 }  // namespace chrome
32
33 void extensions::BundleInstaller::ShowInstalledBubble(
34     const BundleInstaller* bundle, Browser* browser) {
35   // The controller is deallocated when the window is closed, so no need to
36   // worry about it here.
37   [[ExtensionInstalledBubbleController alloc]
38       initWithParentWindow:browser->window()->GetNativeWindow()
39                  extension:NULL
40                     bundle:bundle
41                    browser:browser
42                       icon:SkBitmap()];
43 }