summaryrefslogtreecommitdiffstats
path: root/ui/aura/root_window_mac.mm
blob: 32e42b7ad9d7c5b5a4286db62e38b8cbc8dff9c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#import "ui/aura/root_window_mac.h"

#include "ui/aura/root_window_host_mac.h"

@implementation RootWindowMac

- (id)initWithContentRect:(NSRect)contentRect
                styleMask:(NSUInteger)windowStyle
                  backing:(NSBackingStoreType)bufferingType
                    defer:(BOOL)deferCreation {
  if ((self = [super initWithContentRect:contentRect
                               styleMask:windowStyle
                                 backing:bufferingType
                                   defer:deferCreation])) {
    hostDelegate_ = NULL;
  }
  return self;
}

- (void)setHostDelegate:(aura::RootWindowHostMacDelegate*)hostDelegate {
  hostDelegate_ = hostDelegate;
}

- (void)sendEvent:(NSEvent*)event {
  // Allow both the Cocoa machinery and the Aura machinery to handle the event.
  [super sendEvent:event];
  if (hostDelegate_)
    hostDelegate_->SendEvent(event);
}

@end