| 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 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 #include "components/signin/core/common/profile_management_switches.h" | 88 #include "components/signin/core/common/profile_management_switches.h" |
| 89 #include "components/translate/core/browser/translate_manager.h" | 89 #include "components/translate/core/browser/translate_manager.h" |
| 90 #include "components/translate/core/browser/translate_ui_delegate.h" | 90 #include "components/translate/core/browser/translate_ui_delegate.h" |
| 91 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 91 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 92 #include "content/public/browser/render_view_host.h" | 92 #include "content/public/browser/render_view_host.h" |
| 93 #include "content/public/browser/render_widget_host.h" | 93 #include "content/public/browser/render_widget_host.h" |
| 94 #include "content/public/browser/render_widget_host_view.h" | 94 #include "content/public/browser/render_widget_host_view.h" |
| 95 #include "content/public/browser/web_contents.h" | 95 #include "content/public/browser/web_contents.h" |
| 96 #import "ui/base/cocoa/cocoa_base_utils.h" | 96 #import "ui/base/cocoa/cocoa_base_utils.h" |
| 97 #import "ui/base/cocoa/nsview_additions.h" | 97 #import "ui/base/cocoa/nsview_additions.h" |
| 98 #include "ui/base/material_design/material_design_controller.h" |
| 98 #include "ui/display/screen.h" | 99 #include "ui/display/screen.h" |
| 99 #import "ui/gfx/mac/coordinate_conversion.h" | 100 #import "ui/gfx/mac/coordinate_conversion.h" |
| 100 #include "ui/gfx/mac/scoped_cocoa_disable_screen_updates.h" | 101 #include "ui/gfx/mac/scoped_cocoa_disable_screen_updates.h" |
| 101 | 102 |
| 102 using bookmarks::BookmarkModel; | 103 using bookmarks::BookmarkModel; |
| 103 using bookmarks::BookmarkNode; | 104 using bookmarks::BookmarkNode; |
| 104 | 105 |
| 105 // ORGANIZATION: This is a big file. It is (in principle) organized as follows | 106 // ORGANIZATION: This is a big file. It is (in principle) organized as follows |
| 106 // (in order): | 107 // (in order): |
| 107 // 1. Interfaces. Very short, one-time-use classes may include an implementation | 108 // 1. Interfaces. Very short, one-time-use classes may include an implementation |
| (...skipping 1373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1481 } | 1482 } |
| 1482 | 1483 |
| 1483 // Show the bookmark bubble (e.g. user just clicked on the STAR). | 1484 // Show the bookmark bubble (e.g. user just clicked on the STAR). |
| 1484 - (void)showBookmarkBubbleForURL:(const GURL&)url | 1485 - (void)showBookmarkBubbleForURL:(const GURL&)url |
| 1485 alreadyBookmarked:(BOOL)alreadyMarked { | 1486 alreadyBookmarked:(BOOL)alreadyMarked { |
| 1486 if (bookmarkBubbleObserver_.get()) | 1487 if (bookmarkBubbleObserver_.get()) |
| 1487 return; | 1488 return; |
| 1488 | 1489 |
| 1489 bookmarkBubbleObserver_.reset(new BookmarkBubbleObserverCocoa(self)); | 1490 bookmarkBubbleObserver_.reset(new BookmarkBubbleObserverCocoa(self)); |
| 1490 | 1491 |
| 1491 if (chrome::ToolkitViewsDialogsEnabled()) { | 1492 if (ui::MaterialDesignController::IsSecondaryUiMaterial()) { |
| 1492 chrome::ShowBookmarkBubbleViewsAtPoint( | 1493 chrome::ShowBookmarkBubbleViewsAtPoint( |
| 1493 gfx::ScreenPointFromNSPoint(ui::ConvertPointFromWindowToScreen( | 1494 gfx::ScreenPointFromNSPoint(ui::ConvertPointFromWindowToScreen( |
| 1494 [self window], [self bookmarkBubblePoint])), | 1495 [self window], [self bookmarkBubblePoint])), |
| 1495 [[self window] contentView], bookmarkBubbleObserver_.get(), | 1496 [[self window] contentView], bookmarkBubbleObserver_.get(), |
| 1496 browser_.get(), url, alreadyMarked); | 1497 browser_.get(), url, alreadyMarked); |
| 1497 } else { | 1498 } else { |
| 1498 BookmarkModel* model = | 1499 BookmarkModel* model = |
| 1499 BookmarkModelFactory::GetForBrowserContext(browser_->profile()); | 1500 BookmarkModelFactory::GetForBrowserContext(browser_->profile()); |
| 1500 bookmarks::ManagedBookmarkService* managed = | 1501 bookmarks::ManagedBookmarkService* managed = |
| 1501 ManagedBookmarkServiceFactory::GetForProfile(browser_->profile()); | 1502 ManagedBookmarkServiceFactory::GetForProfile(browser_->profile()); |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1974 | 1975 |
| 1975 - (NSRect)savedRegularWindowFrame { | 1976 - (NSRect)savedRegularWindowFrame { |
| 1976 return savedRegularWindowFrame_; | 1977 return savedRegularWindowFrame_; |
| 1977 } | 1978 } |
| 1978 | 1979 |
| 1979 - (BOOL)isFullscreenTransitionInProgress { | 1980 - (BOOL)isFullscreenTransitionInProgress { |
| 1980 return enteringAppKitFullscreen_ || exitingAppKitFullscreen_; | 1981 return enteringAppKitFullscreen_ || exitingAppKitFullscreen_; |
| 1981 } | 1982 } |
| 1982 | 1983 |
| 1983 @end // @implementation BrowserWindowController(WindowType) | 1984 @end // @implementation BrowserWindowController(WindowType) |
| OLD | NEW |