OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #import <Carbon/Carbon.h> | 5 #import <Carbon/Carbon.h> |
6 | 6 |
7 #include "chrome/browser/tab_contents/tab_contents_view_mac.h" | 7 #include "chrome/browser/tab_contents/tab_contents_view_mac.h" |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); | 147 MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); |
148 NSDragOperation mask = static_cast<NSDragOperation>(allowed_operations); | 148 NSDragOperation mask = static_cast<NSDragOperation>(allowed_operations); |
149 NSPoint offset = NSPointFromCGPoint(image_offset.ToCGPoint()); | 149 NSPoint offset = NSPointFromCGPoint(image_offset.ToCGPoint()); |
150 [cocoa_view_ startDragWithDropData:drop_data | 150 [cocoa_view_ startDragWithDropData:drop_data |
151 dragOperationMask:mask | 151 dragOperationMask:mask |
152 image:gfx::SkBitmapToNSImage(image) | 152 image:gfx::SkBitmapToNSImage(image) |
153 offset:offset]; | 153 offset:offset]; |
154 } | 154 } |
155 | 155 |
156 void TabContentsViewMac::RenderViewCreated(RenderViewHost* host) { | 156 void TabContentsViewMac::RenderViewCreated(RenderViewHost* host) { |
157 // We want updates whenever the intrinsic width of the webpage | 157 // We want updates whenever the intrinsic width of the webpage changes. |
158 // changes. Put the RenderView into that mode. | 158 // Put the RenderView into that mode. The preferred width is used for example |
159 int routing_id = host->routing_id(); | 159 // when the "zoom" button in the browser window is clicked. |
160 host->Send(new ViewMsg_EnablePreferredSizeChangedMode(routing_id)); | 160 host->EnablePreferredSizeChangedMode(kPreferredSizeWidth); |
161 } | 161 } |
162 | 162 |
163 void TabContentsViewMac::SetPageTitle(const std::wstring& title) { | 163 void TabContentsViewMac::SetPageTitle(const std::wstring& title) { |
164 // Meaningless on the Mac; widgets don't have a "title" attribute | 164 // Meaningless on the Mac; widgets don't have a "title" attribute |
165 } | 165 } |
166 | 166 |
167 void TabContentsViewMac::OnTabCrashed() { | 167 void TabContentsViewMac::OnTabCrashed() { |
168 if (!sad_tab_.get()) { | 168 if (!sad_tab_.get()) { |
169 TabContents* contents = tab_contents(); | 169 TabContents* contents = tab_contents(); |
170 DCHECK(contents); | 170 DCHECK(contents); |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 [NSObject cancelPreviousPerformRequestsWithTarget:self | 458 [NSObject cancelPreviousPerformRequestsWithTarget:self |
459 selector:aSel | 459 selector:aSel |
460 object:nil]; | 460 object:nil]; |
461 } | 461 } |
462 | 462 |
463 - (void)closeTabAfterEvent { | 463 - (void)closeTabAfterEvent { |
464 tabContentsView_->CloseTab(); | 464 tabContentsView_->CloseTab(); |
465 } | 465 } |
466 | 466 |
467 @end | 467 @end |
OLD | NEW |