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

Side by Side Diff: chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm

Issue 10880064: Make extension commands grant the activeTab permission. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 8 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 | Annotate | Revision Log
OLDNEW
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 #include "chrome/browser/ui/cocoa/extensions/shell_window_cocoa.h" 5 #include "chrome/browser/ui/cocoa/extensions/shell_window_cocoa.h"
6 6
7 #include "base/mac/mac_util.h" 7 #include "base/mac/mac_util.h"
8 #include "base/sys_string_conversions.h" 8 #include "base/sys_string_conversions.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/cocoa/browser_window_utils.h" 10 #include "chrome/browser/ui/cocoa/browser_window_utils.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 [[ShellWindowController alloc] initWithWindow:window.release()]); 217 [[ShellWindowController alloc] initWithWindow:window.release()]);
218 218
219 NSView* view = web_contents()->GetView()->GetNativeView(); 219 NSView* view = web_contents()->GetView()->GetNativeView();
220 [view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; 220 [view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
221 221
222 InstallView(); 222 InstallView();
223 223
224 [[window_controller_ window] setDelegate:window_controller_]; 224 [[window_controller_ window] setDelegate:window_controller_];
225 [window_controller_ setShellWindow:this]; 225 [window_controller_ setShellWindow:this];
226 226
227 extension_keybinding_registry_.reset( 227 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryCocoa(
228 new ExtensionKeybindingRegistryCocoa(shell_window_->profile(), window, 228 shell_window_->profile(),
229 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY)); 229 window,
230 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY,
231 shell_window));
230 } 232 }
231 233
232 void ShellWindowCocoa::InstallView() { 234 void ShellWindowCocoa::InstallView() {
233 NSView* view = web_contents()->GetView()->GetNativeView(); 235 NSView* view = web_contents()->GetView()->GetNativeView();
234 if (has_frame_) { 236 if (has_frame_) {
235 [view setFrame:[[window() contentView] bounds]]; 237 [view setFrame:[[window() contentView] bounds]];
236 [[window() contentView] addSubview:view]; 238 [[window() contentView] addSubview:view];
237 } else { 239 } else {
238 // TODO(jeremya): find a cleaner way to send this information to the 240 // TODO(jeremya): find a cleaner way to send this information to the
239 // WebContentsViewCocoa view. 241 // WebContentsViewCocoa view.
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 NSWindow* window = [window_controller_ window]; 537 NSWindow* window = [window_controller_ window];
536 CHECK(!window || [window isKindOfClass:[ShellNSWindow class]]); 538 CHECK(!window || [window isKindOfClass:[ShellNSWindow class]]);
537 return static_cast<ShellNSWindow*>(window); 539 return static_cast<ShellNSWindow*>(window);
538 } 540 }
539 541
540 // static 542 // static
541 NativeShellWindow* NativeShellWindow::Create( 543 NativeShellWindow* NativeShellWindow::Create(
542 ShellWindow* shell_window, const ShellWindow::CreateParams& params) { 544 ShellWindow* shell_window, const ShellWindow::CreateParams& params) {
543 return new ShellWindowCocoa(shell_window, params); 545 return new ShellWindowCocoa(shell_window, params);
544 } 546 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/extensions/extension_keybinding_registry_cocoa.mm ('k') | chrome/browser/ui/extensions/shell_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698