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

Side by Side Diff: chrome/browser/cocoa/extension_view_mac.mm

Issue 402077: Adds popups to browser actions, completing the feature.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/cocoa/extensions/browser_actions_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/cocoa/extension_view_mac.h" 5 #include "chrome/browser/cocoa/extension_view_mac.h"
6 6
7 #include "chrome/browser/extensions/extension_host.h" 7 #include "chrome/browser/extensions/extension_host.h"
8 #include "chrome/browser/renderer_host/render_view_host.h" 8 #include "chrome/browser/renderer_host/render_view_host.h"
9 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" 9 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h"
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 void ExtensionViewMac::UpdatePreferredSize(const gfx::Size& new_size) { 47 void ExtensionViewMac::UpdatePreferredSize(const gfx::Size& new_size) {
48 // TODO(thakis, erikkay): Windows does some tricks to resize the extension 48 // TODO(thakis, erikkay): Windows does some tricks to resize the extension
49 // view not before it's visible. Do something similar here. 49 // view not before it's visible. Do something similar here.
50 50
51 // No need to use CA here, our caller calls us repeatedly to animate the 51 // No need to use CA here, our caller calls us repeatedly to animate the
52 // resizing. 52 // resizing.
53 NSView* view = native_view(); 53 NSView* view = native_view();
54 NSRect frame = [view frame]; 54 NSRect frame = [view frame];
55 frame.size.width = new_size.width(); 55 frame.size.width = new_size.width();
56 frame.size.height = new_size.height();
56 57
57 // RenderWidgetHostViewCocoa overrides setFrame but not setFrameSize. 58 // RenderWidgetHostViewCocoa overrides setFrame but not setFrameSize.
58 [view setFrame:frame]; 59 [view setFrame:frame];
59 [view setNeedsDisplay:YES]; 60 [view setNeedsDisplay:YES];
60 } 61 }
61 62
62 void ExtensionViewMac::RenderViewCreated() { 63 void ExtensionViewMac::RenderViewCreated() {
63 if (!pending_background_.empty() && render_view_host()->view()) { 64 if (!pending_background_.empty() && render_view_host()->view()) {
64 render_widget_host_view_->SetBackground(pending_background_); 65 render_widget_host_view_->SetBackground(pending_background_);
65 pending_background_.reset(); 66 pending_background_.reset();
66 } 67 }
67 } 68 }
68 69
69 void ExtensionViewMac::CreateWidgetHostView() { 70 void ExtensionViewMac::CreateWidgetHostView() {
70 DCHECK(!render_widget_host_view_); 71 DCHECK(!render_widget_host_view_);
71 render_widget_host_view_ = new RenderWidgetHostViewMac(render_view_host()); 72 render_widget_host_view_ = new RenderWidgetHostViewMac(render_view_host());
72 73
73 // The RenderWidgetHostViewMac is owned by its native view, which is created 74 // The RenderWidgetHostViewMac is owned by its native view, which is created
74 // in an autoreleased state. retain it, so that it doesn't immediately 75 // in an autoreleased state. retain it, so that it doesn't immediately
75 // disappear. 76 // disappear.
76 [render_widget_host_view_->native_view() retain]; 77 [render_widget_host_view_->native_view() retain];
77 78
78 extension_host_->CreateRenderView(render_widget_host_view_); 79 extension_host_->CreateRenderView(render_widget_host_view_);
79 } 80 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/cocoa/extensions/browser_actions_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698