OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/browser_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <numeric> | 8 #include <numeric> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 #include "chrome/browser/ui/translate/translate_bubble_model_impl.h" | 77 #include "chrome/browser/ui/translate/translate_bubble_model_impl.h" |
78 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" | 78 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" |
79 #include "chrome/browser/ui/window_sizer/window_sizer.h" | 79 #include "chrome/browser/ui/window_sizer/window_sizer.h" |
80 #include "chrome/common/chrome_switches.h" | 80 #include "chrome/common/chrome_switches.h" |
81 #include "chrome/common/extensions/command.h" | 81 #include "chrome/common/extensions/command.h" |
82 #include "chrome/common/url_constants.h" | 82 #include "chrome/common/url_constants.h" |
83 #include "components/bookmarks/browser/bookmark_model.h" | 83 #include "components/bookmarks/browser/bookmark_model.h" |
84 #include "components/signin/core/common/profile_management_switches.h" | 84 #include "components/signin/core/common/profile_management_switches.h" |
85 #include "components/translate/core/browser/translate_manager.h" | 85 #include "components/translate/core/browser/translate_manager.h" |
86 #include "components/translate/core/browser/translate_ui_delegate.h" | 86 #include "components/translate/core/browser/translate_ui_delegate.h" |
| 87 #include "components/web_modal/popup_manager.h" |
87 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 88 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
88 #include "content/public/browser/render_view_host.h" | 89 #include "content/public/browser/render_view_host.h" |
89 #include "content/public/browser/render_widget_host_view.h" | 90 #include "content/public/browser/render_widget_host_view.h" |
90 #include "content/public/browser/web_contents.h" | 91 #include "content/public/browser/web_contents.h" |
91 #include "grit/chromium_strings.h" | 92 #include "grit/chromium_strings.h" |
92 #include "grit/generated_resources.h" | 93 #include "grit/generated_resources.h" |
93 #include "grit/locale_settings.h" | 94 #include "grit/locale_settings.h" |
94 #import "ui/base/cocoa/cocoa_base_utils.h" | 95 #import "ui/base/cocoa/cocoa_base_utils.h" |
95 #include "ui/base/l10n/l10n_util.h" | 96 #include "ui/base/l10n/l10n_util.h" |
96 #include "ui/base/l10n/l10n_util_mac.h" | 97 #include "ui/base/l10n/l10n_util_mac.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // any shrink whether we're both zoomed and have previously grown -- if so, we | 172 // any shrink whether we're both zoomed and have previously grown -- if so, we |
172 // set a flag, and constrain any resize by the allowed amounts. On further | 173 // set a flag, and constrain any resize by the allowed amounts. On further |
173 // shrinks, we check the flag (since the size/position of the window will no | 174 // shrinks, we check the flag (since the size/position of the window will no |
174 // longer indicate that the window is shrinking from an apparent zoomed state) | 175 // longer indicate that the window is shrinking from an apparent zoomed state) |
175 // and if it's set we continue to constrain the resize. | 176 // and if it's set we continue to constrain the resize. |
176 | 177 |
177 using content::OpenURLParams; | 178 using content::OpenURLParams; |
178 using content::Referrer; | 179 using content::Referrer; |
179 using content::RenderWidgetHostView; | 180 using content::RenderWidgetHostView; |
180 using content::WebContents; | 181 using content::WebContents; |
181 using web_modal::WebContentsModalDialogManager; | |
182 | 182 |
183 @interface NSWindow (NSPrivateApis) | 183 @interface NSWindow (NSPrivateApis) |
184 // Note: These functions are private, use -[NSObject respondsToSelector:] | 184 // Note: These functions are private, use -[NSObject respondsToSelector:] |
185 // before calling them. | 185 // before calling them. |
186 | 186 |
187 - (void)setBottomCornerRounded:(BOOL)rounded; | 187 - (void)setBottomCornerRounded:(BOOL)rounded; |
188 | 188 |
189 - (NSRect)_growBoxRect; | 189 - (NSRect)_growBoxRect; |
190 | 190 |
191 @end | 191 @end |
(...skipping 1409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1601 } | 1601 } |
1602 | 1602 |
1603 - (BOOL)isTabDraggable:(NSView*)tabView { | 1603 - (BOOL)isTabDraggable:(NSView*)tabView { |
1604 // TODO(avi, thakis): ConstrainedWindowSheetController has no api to move | 1604 // TODO(avi, thakis): ConstrainedWindowSheetController has no api to move |
1605 // tabsheets between windows. Until then, we have to prevent having to move a | 1605 // tabsheets between windows. Until then, we have to prevent having to move a |
1606 // tabsheet between windows, e.g. no tearing off of tabs. | 1606 // tabsheet between windows, e.g. no tearing off of tabs. |
1607 int index = [tabStripController_ modelIndexForTabView:tabView]; | 1607 int index = [tabStripController_ modelIndexForTabView:tabView]; |
1608 WebContents* contents = browser_->tab_strip_model()->GetWebContentsAt(index); | 1608 WebContents* contents = browser_->tab_strip_model()->GetWebContentsAt(index); |
1609 if (!contents) | 1609 if (!contents) |
1610 return NO; | 1610 return NO; |
1611 return !WebContentsModalDialogManager::FromWebContents(contents)-> | 1611 |
1612 IsDialogActive(); | 1612 return !web_modal::PopupManager::FromWebContents(contents)-> |
| 1613 IsWebModalDialogActive(contents); |
1613 } | 1614 } |
1614 | 1615 |
1615 // TabStripControllerDelegate protocol. | 1616 // TabStripControllerDelegate protocol. |
1616 - (void)onActivateTabWithContents:(WebContents*)contents { | 1617 - (void)onActivateTabWithContents:(WebContents*)contents { |
1617 // Update various elements that are interested in knowing the current | 1618 // Update various elements that are interested in knowing the current |
1618 // WebContents. | 1619 // WebContents. |
1619 | 1620 |
1620 // Update all the UI bits. | 1621 // Update all the UI bits. |
1621 windowShim_->UpdateTitleBar(); | 1622 windowShim_->UpdateTitleBar(); |
1622 | 1623 |
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2291 | 2292 |
2292 - (BOOL)supportsBookmarkBar { | 2293 - (BOOL)supportsBookmarkBar { |
2293 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2294 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
2294 } | 2295 } |
2295 | 2296 |
2296 - (BOOL)isTabbedWindow { | 2297 - (BOOL)isTabbedWindow { |
2297 return browser_->is_type_tabbed(); | 2298 return browser_->is_type_tabbed(); |
2298 } | 2299 } |
2299 | 2300 |
2300 @end // @implementation BrowserWindowController(WindowType) | 2301 @end // @implementation BrowserWindowController(WindowType) |
OLD | NEW |