| OLD | NEW |
| 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 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" | 5 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/mac/bundle_locations.h" | 8 #include "base/mac/bundle_locations.h" |
| 9 #include "base/mac/mac_util.h" | 9 #include "base/mac/mac_util.h" |
| 10 #include "base/memory/scoped_nsobject.h" | 10 #include "base/memory/scoped_nsobject.h" |
| 11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
| 12 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 12 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 13 #import "chrome/browser/ui/cocoa/info_bubble_view.h" | 13 #import "chrome/browser/ui/cocoa/info_bubble_view.h" |
| 14 #import "chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h" | 14 #import "chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h" |
| 15 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
| 16 #include "ui/base/l10n/l10n_util.h" | 16 #include "ui/base/l10n/l10n_util.h" |
| 17 | 17 |
| 18 @interface BaseBubbleController (Private) | 18 @interface BaseBubbleController (Private) |
| 19 - (void)updateOriginFromAnchor; | 19 - (void)updateOriginFromAnchor; |
| 20 - (void)activateTabWithContents:(TabContents*)newContents | 20 - (void)activateTabWithContents:(content::WebContents*)newContents |
| 21 previousContents:(TabContents*)oldContents | 21 previousContents:(content::WebContents*)oldContents |
| 22 atIndex:(NSInteger)index | 22 atIndex:(NSInteger)index |
| 23 userGesture:(bool)wasUserGesture; | 23 userGesture:(bool)wasUserGesture; |
| 24 @end | 24 @end |
| 25 | 25 |
| 26 @implementation BaseBubbleController | 26 @implementation BaseBubbleController |
| 27 | 27 |
| 28 @synthesize parentWindow = parentWindow_; | 28 @synthesize parentWindow = parentWindow_; |
| 29 @synthesize anchorPoint = anchor_; | 29 @synthesize anchorPoint = anchor_; |
| 30 @synthesize bubble = bubble_; | 30 @synthesize bubble = bubble_; |
| 31 | 31 |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 break; | 269 break; |
| 270 | 270 |
| 271 default: | 271 default: |
| 272 NOTREACHED(); | 272 NOTREACHED(); |
| 273 } | 273 } |
| 274 | 274 |
| 275 origin.y -= NSHeight([window frame]); | 275 origin.y -= NSHeight([window frame]); |
| 276 [window setFrameOrigin:origin]; | 276 [window setFrameOrigin:origin]; |
| 277 } | 277 } |
| 278 | 278 |
| 279 - (void)activateTabWithContents:(TabContents*)newContents | 279 - (void)activateTabWithContents:(content::WebContents*)newContents |
| 280 previousContents:(TabContents*)oldContents | 280 previousContents:(content::WebContents*)oldContents |
| 281 atIndex:(NSInteger)index | 281 atIndex:(NSInteger)index |
| 282 userGesture:(bool)wasUserGesture { | 282 userGesture:(bool)wasUserGesture { |
| 283 // The user switched tabs; close. | 283 // The user switched tabs; close. |
| 284 [self close]; | 284 [self close]; |
| 285 } | 285 } |
| 286 | 286 |
| 287 @end // BaseBubbleController | 287 @end // BaseBubbleController |
| OLD | NEW |