Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_controller.mm

Issue 287123002: [WebModals] New API for browser-scoped popup management. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after
1602 } 1602 }
1603 1603
1604 - (BOOL)isTabDraggable:(NSView*)tabView { 1604 - (BOOL)isTabDraggable:(NSView*)tabView {
1605 // TODO(avi, thakis): ConstrainedWindowSheetController has no api to move 1605 // TODO(avi, thakis): ConstrainedWindowSheetController has no api to move
1606 // tabsheets between windows. Until then, we have to prevent having to move a 1606 // tabsheets between windows. Until then, we have to prevent having to move a
1607 // tabsheet between windows, e.g. no tearing off of tabs. 1607 // tabsheet between windows, e.g. no tearing off of tabs.
1608 int index = [tabStripController_ modelIndexForTabView:tabView]; 1608 int index = [tabStripController_ modelIndexForTabView:tabView];
1609 WebContents* contents = browser_->tab_strip_model()->GetWebContentsAt(index); 1609 WebContents* contents = browser_->tab_strip_model()->GetWebContentsAt(index);
1610 if (!contents) 1610 if (!contents)
1611 return NO; 1611 return NO;
1612 return !WebContentsModalDialogManager::FromWebContents(contents)-> 1612
1613 IsDialogActive(); 1613 return !web_modal::PopupManager::FromWebContents(contents)->
1614 IsWebModalDialogActive(contents);
1614 } 1615 }
1615 1616
1616 // TabStripControllerDelegate protocol. 1617 // TabStripControllerDelegate protocol.
1617 - (void)onActivateTabWithContents:(WebContents*)contents { 1618 - (void)onActivateTabWithContents:(WebContents*)contents {
1618 // Update various elements that are interested in knowing the current 1619 // Update various elements that are interested in knowing the current
1619 // WebContents. 1620 // WebContents.
1620 1621
1621 // Update all the UI bits. 1622 // Update all the UI bits.
1622 windowShim_->UpdateTitleBar(); 1623 windowShim_->UpdateTitleBar();
1623 1624
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
2293 2294
2294 - (BOOL)supportsBookmarkBar { 2295 - (BOOL)supportsBookmarkBar {
2295 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; 2296 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR];
2296 } 2297 }
2297 2298
2298 - (BOOL)isTabbedWindow { 2299 - (BOOL)isTabbedWindow {
2299 return browser_->is_type_tabbed(); 2300 return browser_->is_type_tabbed();
2300 } 2301 }
2301 2302
2302 @end // @implementation BrowserWindowController(WindowType) 2303 @end // @implementation BrowserWindowController(WindowType)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698