| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 58 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 59 #include "content/public/browser/navigation_controller.h" | 59 #include "content/public/browser/navigation_controller.h" |
| 60 #include "content/public/browser/user_metrics.h" | 60 #include "content/public/browser/user_metrics.h" |
| 61 #include "content/public/browser/web_contents.h" | 61 #include "content/public/browser/web_contents.h" |
| 62 #include "content/public/browser/web_contents_view.h" | 62 #include "content/public/browser/web_contents_view.h" |
| 63 #include "grit/generated_resources.h" | 63 #include "grit/generated_resources.h" |
| 64 #include "grit/theme_resources.h" | 64 #include "grit/theme_resources.h" |
| 65 #include "grit/ui_resources.h" | 65 #include "grit/ui_resources.h" |
| 66 #include "skia/ext/skia_utils_mac.h" | 66 #include "skia/ext/skia_utils_mac.h" |
| 67 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" | 67 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" |
| 68 #import "ui/base/animation/animation_container.h" | |
| 69 #include "ui/base/cocoa/animation_utils.h" | 68 #include "ui/base/cocoa/animation_utils.h" |
| 70 #import "ui/base/cocoa/tracking_area.h" | 69 #import "ui/base/cocoa/tracking_area.h" |
| 71 #include "ui/base/l10n/l10n_util.h" | 70 #include "ui/base/l10n/l10n_util.h" |
| 72 #include "ui/base/models/list_selection_model.h" | 71 #include "ui/base/models/list_selection_model.h" |
| 73 #include "ui/base/resource/resource_bundle.h" | 72 #include "ui/base/resource/resource_bundle.h" |
| 74 #include "ui/base/theme_provider.h" | 73 #include "ui/base/theme_provider.h" |
| 74 #include "ui/gfx/animation/animation_container.h" |
| 75 #include "ui/gfx/image/image.h" | 75 #include "ui/gfx/image/image.h" |
| 76 | 76 |
| 77 using content::OpenURLParams; | 77 using content::OpenURLParams; |
| 78 using content::Referrer; | 78 using content::Referrer; |
| 79 using content::UserMetricsAction; | 79 using content::UserMetricsAction; |
| 80 using content::WebContents; | 80 using content::WebContents; |
| 81 | 81 |
| 82 namespace { | 82 namespace { |
| 83 | 83 |
| 84 // A value to indicate tab layout should use the full available width of the | 84 // A value to indicate tab layout should use the full available width of the |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 switchView_ = switchView; | 495 switchView_ = switchView; |
| 496 browser_ = browser; | 496 browser_ = browser; |
| 497 tabStripModel_ = browser_->tab_strip_model(); | 497 tabStripModel_ = browser_->tab_strip_model(); |
| 498 hoverTabSelector_.reset(new HoverTabSelector(tabStripModel_)); | 498 hoverTabSelector_.reset(new HoverTabSelector(tabStripModel_)); |
| 499 delegate_ = delegate; | 499 delegate_ = delegate; |
| 500 bridge_.reset(new TabStripModelObserverBridge(tabStripModel_, self)); | 500 bridge_.reset(new TabStripModelObserverBridge(tabStripModel_, self)); |
| 501 dragController_.reset( | 501 dragController_.reset( |
| 502 [[TabStripDragController alloc] initWithTabStripController:self]); | 502 [[TabStripDragController alloc] initWithTabStripController:self]); |
| 503 tabContentsArray_.reset([[NSMutableArray alloc] init]); | 503 tabContentsArray_.reset([[NSMutableArray alloc] init]); |
| 504 tabArray_.reset([[NSMutableArray alloc] init]); | 504 tabArray_.reset([[NSMutableArray alloc] init]); |
| 505 animationContainer_ = new ui::AnimationContainer; | 505 animationContainer_ = new gfx::AnimationContainer; |
| 506 NSWindow* browserWindow = [view window]; | 506 NSWindow* browserWindow = [view window]; |
| 507 | 507 |
| 508 // Important note: any non-tab subviews not added to |permanentSubviews_| | 508 // Important note: any non-tab subviews not added to |permanentSubviews_| |
| 509 // (see |-addSubviewToPermanentList:|) will be wiped out. | 509 // (see |-addSubviewToPermanentList:|) will be wiped out. |
| 510 permanentSubviews_.reset([[NSMutableArray alloc] init]); | 510 permanentSubviews_.reset([[NSMutableArray alloc] init]); |
| 511 | 511 |
| 512 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 512 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 513 defaultFavicon_.reset( | 513 defaultFavicon_.reset( |
| 514 rb.GetNativeImageNamed(IDR_DEFAULT_FAVICON).CopyNSImage()); | 514 rb.GetNativeImageNamed(IDR_DEFAULT_FAVICON).CopyNSImage()); |
| 515 | 515 |
| (...skipping 1785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2301 NSView* GetSheetParentViewForWebContents(WebContents* web_contents) { | 2301 NSView* GetSheetParentViewForWebContents(WebContents* web_contents) { |
| 2302 // View hierarchy of the contents view: | 2302 // View hierarchy of the contents view: |
| 2303 // NSView -- switchView, same for all tabs | 2303 // NSView -- switchView, same for all tabs |
| 2304 // +- NSView -- TabContentsController's view | 2304 // +- NSView -- TabContentsController's view |
| 2305 // +- TabContentsViewCocoa | 2305 // +- TabContentsViewCocoa |
| 2306 // | 2306 // |
| 2307 // Changing it? Do not forget to modify | 2307 // Changing it? Do not forget to modify |
| 2308 // -[TabStripController swapInTabAtIndex:] too. | 2308 // -[TabStripController swapInTabAtIndex:] too. |
| 2309 return [web_contents->GetView()->GetNativeView() superview]; | 2309 return [web_contents->GetView()->GetNativeView() superview]; |
| 2310 } | 2310 } |
| OLD | NEW |