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

Side by Side Diff: chrome/browser/ui/views/frame/browser_frame_mac.mm

Issue 1250403002: [Mac] Move UI item validation to UserInterfaceItemCommandHandler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@commandexecute
Patch Set: Properly release |commandHandler|. Created 5 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/views/frame/browser_frame_mac.h" 5 #include "chrome/browser/ui/views/frame/browser_frame_mac.h"
6 6
7 #import "chrome/browser/ui/cocoa/browser_window_command_handler.h"
7 #import "chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.h" 8 #import "chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.h"
8 #include "chrome/browser/ui/views/frame/browser_frame.h" 9 #include "chrome/browser/ui/views/frame/browser_frame.h"
9 #include "chrome/browser/ui/views/frame/browser_shutdown.h" 10 #include "chrome/browser/ui/views/frame/browser_shutdown.h"
10 #include "chrome/browser/ui/views/frame/browser_view.h" 11 #include "chrome/browser/ui/views/frame/browser_view.h"
11 #import "chrome/browser/ui/views/frame/native_widget_mac_frameless_nswindow.h" 12 #import "chrome/browser/ui/views/frame/native_widget_mac_frameless_nswindow.h"
12 #include "components/web_modal/web_contents_modal_dialog_host.h" 13 #include "components/web_modal/web_contents_modal_dialog_host.h"
13 #import "ui/base/cocoa/window_size_constants.h" 14 #import "ui/base/cocoa/window_size_constants.h"
14 15
15 BrowserFrameMac::BrowserFrameMac(BrowserFrame* browser_frame, 16 BrowserFrameMac::BrowserFrameMac(BrowserFrame* browser_frame,
16 BrowserView* browser_view) 17 BrowserView* browser_view)
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 NSUInteger style_mask = NSTitledWindowMask | NSClosableWindowMask | 64 NSUInteger style_mask = NSTitledWindowMask | NSClosableWindowMask |
64 NSMiniaturizableWindowMask | NSResizableWindowMask | 65 NSMiniaturizableWindowMask | NSResizableWindowMask |
65 NSTexturedBackgroundWindowMask; 66 NSTexturedBackgroundWindowMask;
66 base::scoped_nsobject<NativeWidgetMacFramelessNSWindow> ns_window( 67 base::scoped_nsobject<NativeWidgetMacFramelessNSWindow> ns_window(
67 [[NativeWidgetMacFramelessNSWindow alloc] 68 [[NativeWidgetMacFramelessNSWindow alloc]
68 initWithContentRect:ui::kWindowSizeDeterminedLater 69 initWithContentRect:ui::kWindowSizeDeterminedLater
69 styleMask:style_mask 70 styleMask:style_mask
70 backing:NSBackingStoreBuffered 71 backing:NSBackingStoreBuffered
71 defer:NO]); 72 defer:NO]);
72 [ns_window setCommandDispatcherDelegate:command_dispatcher_delegate_]; 73 [ns_window setCommandDispatcherDelegate:command_dispatcher_delegate_];
74 [ns_window setCommandHandler:[[[BrowserWindowCommandHandler alloc] init]
75 autorelease]];
73 return ns_window.autorelease(); 76 return ns_window.autorelease();
74 } 77 }
75 78
76 //////////////////////////////////////////////////////////////////////////////// 79 ////////////////////////////////////////////////////////////////////////////////
77 // BrowserFrameMac, NativeBrowserFrame implementation: 80 // BrowserFrameMac, NativeBrowserFrame implementation:
78 81
79 views::Widget::InitParams BrowserFrameMac::GetWidgetParams() { 82 views::Widget::InitParams BrowserFrameMac::GetWidgetParams() {
80 views::Widget::InitParams params; 83 views::Widget::InitParams params;
81 params.native_widget = this; 84 params.native_widget = this;
82 return params; 85 return params;
(...skipping 14 matching lines...) Expand all
97 void BrowserFrameMac::GetWindowPlacement( 100 void BrowserFrameMac::GetWindowPlacement(
98 gfx::Rect* bounds, 101 gfx::Rect* bounds,
99 ui::WindowShowState* show_state) const { 102 ui::WindowShowState* show_state) const {
100 return NativeWidgetMac::GetWindowPlacement(bounds, show_state); 103 return NativeWidgetMac::GetWindowPlacement(bounds, show_state);
101 } 104 }
102 105
103 int BrowserFrameMac::GetMinimizeButtonOffset() const { 106 int BrowserFrameMac::GetMinimizeButtonOffset() const {
104 NOTIMPLEMENTED(); 107 NOTIMPLEMENTED();
105 return 0; 108 return 0;
106 } 109 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/chrome_event_processing_window.mm ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698