Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(566)

Unified Diff: chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm

Issue 10119003: Pull shell window stuff out of ExtensionHost and put in ShellWindow (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Comments Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm b/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
index 9487eabd5b7e5a44611223c10d97002186b2d657..01e41fb926a0866f80c6cb8696c3c00c7aaa67d5 100644
--- a/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
@@ -5,10 +5,12 @@
#include "chrome/browser/ui/cocoa/extensions/shell_window_cocoa.h"
#include "base/sys_string_conversions.h"
-#include "chrome/browser/extensions/extension_host.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/cocoa/browser_window_utils.h"
#include "chrome/browser/ui/cocoa/extensions/extension_view_mac.h"
#include "chrome/common/extensions/extension.h"
+#include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_contents_view.h"
#import "ui/base/cocoa/underlay_opengl_hosting_window.h"
@implementation ShellWindowController
@@ -22,8 +24,10 @@
@end
-ShellWindowCocoa::ShellWindowCocoa(ExtensionHost* host)
- : ShellWindow(host),
+ShellWindowCocoa::ShellWindowCocoa(Profile* profile,
+ const Extension* extension,
+ const GURL& url)
+ : ShellWindow(profile, extension, url),
attention_request_id_(0) {
NSRect rect = NSMakeRect(0, 0, kDefaultWidth, kDefaultHeight);
NSUInteger styleMask = NSTitledWindowMask | NSClosableWindowMask |
@@ -33,9 +37,9 @@ ShellWindowCocoa::ShellWindowCocoa(ExtensionHost* host)
styleMask:styleMask
backing:NSBackingStoreBuffered
defer:NO]);
- [window setTitle:base::SysUTF8ToNSString(host->extension()->name())];
+ [window setTitle:base::SysUTF8ToNSString(extension->name())];
- NSView* view = host->view()->native_view();
+ NSView* view = web_contents()->GetView()->GetNativeView();
[view setFrame:rect];
[view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[[window contentView] addSubview:view];
@@ -165,6 +169,8 @@ NSWindow* ShellWindowCocoa::window() const {
}
// static
-ShellWindow* ShellWindow::CreateShellWindow(ExtensionHost* host) {
- return new ShellWindowCocoa(host);
+ShellWindow* ShellWindow::CreateImpl(Profile* profile,
+ const Extension* extension,
+ const GURL& url) {
+ return new ShellWindowCocoa(profile, extension, url);
}
« no previous file with comments | « chrome/browser/ui/cocoa/extensions/shell_window_cocoa.h ('k') | chrome/browser/ui/extensions/shell_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698