| 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/tabs/tab_strip_controller.h" | 5 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" |
| 6 | 6 |
| 7 #import <QuartzCore/QuartzCore.h> | 7 #import <QuartzCore/QuartzCore.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 #include "components/url_formatter/url_fixer.h" | 55 #include "components/url_formatter/url_fixer.h" |
| 56 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 56 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 57 #include "content/public/browser/navigation_controller.h" | 57 #include "content/public/browser/navigation_controller.h" |
| 58 #include "content/public/browser/user_metrics.h" | 58 #include "content/public/browser/user_metrics.h" |
| 59 #include "content/public/browser/web_contents.h" | 59 #include "content/public/browser/web_contents.h" |
| 60 #include "grit/components_scaled_resources.h" | 60 #include "grit/components_scaled_resources.h" |
| 61 #include "grit/theme_resources.h" | 61 #include "grit/theme_resources.h" |
| 62 #include "skia/ext/skia_utils_mac.h" | 62 #include "skia/ext/skia_utils_mac.h" |
| 63 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSAnimation+Duration.h
" | 63 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSAnimation+Duration.h
" |
| 64 #include "ui/base/cocoa/animation_utils.h" | 64 #include "ui/base/cocoa/animation_utils.h" |
| 65 #include "ui/base/cocoa/cocoa_base_utils.h" |
| 65 #import "ui/base/cocoa/tracking_area.h" | 66 #import "ui/base/cocoa/tracking_area.h" |
| 66 #include "ui/base/l10n/l10n_util.h" | 67 #include "ui/base/l10n/l10n_util.h" |
| 67 #include "ui/base/material_design/material_design_controller.h" | 68 #include "ui/base/material_design/material_design_controller.h" |
| 68 #include "ui/base/models/list_selection_model.h" | 69 #include "ui/base/models/list_selection_model.h" |
| 69 #include "ui/base/resource/resource_bundle.h" | 70 #include "ui/base/resource/resource_bundle.h" |
| 70 #include "ui/base/theme_provider.h" | 71 #include "ui/base/theme_provider.h" |
| 71 #include "ui/gfx/image/image.h" | 72 #include "ui/gfx/image/image.h" |
| 72 #include "ui/gfx/mac/scoped_cocoa_disable_screen_updates.h" | 73 #include "ui/gfx/mac/scoped_cocoa_disable_screen_updates.h" |
| 73 #include "ui/resources/grit/ui_resources.h" | 74 #include "ui/resources/grit/ui_resources.h" |
| 74 | 75 |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 [self trackClickForWindowMove:event]; | 264 [self trackClickForWindowMove:event]; |
| 264 return; | 265 return; |
| 265 } | 266 } |
| 266 } | 267 } |
| 267 [super mouseDown:event]; | 268 [super mouseDown:event]; |
| 268 } | 269 } |
| 269 | 270 |
| 270 - (void)trackClickForWindowMove:(NSEvent*)event { | 271 - (void)trackClickForWindowMove:(NSEvent*)event { |
| 271 NSWindow* window = [self window]; | 272 NSWindow* window = [self window]; |
| 272 NSPoint frameOrigin = [window frame].origin; | 273 NSPoint frameOrigin = [window frame].origin; |
| 273 NSPoint lastEventLoc = [window convertBaseToScreen:[event locationInWindow]]; | 274 NSPoint lastEventLoc = |
| 275 ui::ConvertPointFromWindowToScreen(window, [event locationInWindow]); |
| 274 while ((event = [NSApp nextEventMatchingMask: | 276 while ((event = [NSApp nextEventMatchingMask: |
| 275 NSLeftMouseDownMask|NSLeftMouseDraggedMask|NSLeftMouseUpMask | 277 NSLeftMouseDownMask|NSLeftMouseDraggedMask|NSLeftMouseUpMask |
| 276 untilDate:[NSDate distantFuture] | 278 untilDate:[NSDate distantFuture] |
| 277 inMode:NSEventTrackingRunLoopMode | 279 inMode:NSEventTrackingRunLoopMode |
| 278 dequeue:YES]) && | 280 dequeue:YES]) && |
| 279 [event type] != NSLeftMouseUp) { | 281 [event type] != NSLeftMouseUp) { |
| 280 base::mac::ScopedNSAutoreleasePool pool; | 282 base::mac::ScopedNSAutoreleasePool pool; |
| 281 | 283 |
| 282 NSPoint now = [window convertBaseToScreen:[event locationInWindow]]; | 284 NSPoint now = |
| 285 ui::ConvertPointFromWindowToScreen(window, [event locationInWindow]); |
| 283 frameOrigin.x += now.x - lastEventLoc.x; | 286 frameOrigin.x += now.x - lastEventLoc.x; |
| 284 frameOrigin.y += now.y - lastEventLoc.y; | 287 frameOrigin.y += now.y - lastEventLoc.y; |
| 285 [window setFrameOrigin:frameOrigin]; | 288 [window setFrameOrigin:frameOrigin]; |
| 286 lastEventLoc = now; | 289 lastEventLoc = now; |
| 287 } | 290 } |
| 288 } | 291 } |
| 289 | 292 |
| 290 @end | 293 @end |
| 291 | 294 |
| 292 #pragma mark - | 295 #pragma mark - |
| (...skipping 1995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2288 | 2291 |
| 2289 - (TabMediaState)mediaStateForContents:(content::WebContents*)contents { | 2292 - (TabMediaState)mediaStateForContents:(content::WebContents*)contents { |
| 2290 return chrome::GetTabMediaStateForContents(contents); | 2293 return chrome::GetTabMediaStateForContents(contents); |
| 2291 } | 2294 } |
| 2292 | 2295 |
| 2293 - (void)themeDidChangeNotification:(NSNotification*)notification { | 2296 - (void)themeDidChangeNotification:(NSNotification*)notification { |
| 2294 [newTabButton_ setImages]; | 2297 [newTabButton_ setImages]; |
| 2295 } | 2298 } |
| 2296 | 2299 |
| 2297 @end | 2300 @end |
| OLD | NEW |