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

Unified Diff: chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm

Issue 866263008: MacViews: Unify web contents modal dialog types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ValidationMessageBubble
Patch Set: Another idea Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm
diff --git a/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm b/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm
index bd76c519f854565853fd3084fce295f0286686c4..831be5e857a1ffa768c1f450adf97a822a5e486a 100644
--- a/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm
+++ b/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm
@@ -15,12 +15,12 @@
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/profiles/profile.h"
-#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sheet.h"
#import "chrome/browser/ui/cocoa/content_settings/cookie_details_view_controller.h"
#import "chrome/browser/ui/cocoa/vertical_gradient_view.h"
#include "chrome/browser/ui/collected_cookies_infobar_delegate.h"
#include "chrome/common/pref_names.h"
#include "chrome/grit/generated_resources.h"
+#include "components/web_modal/web_contents_modal_dialog_manager.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/web_contents.h"
@@ -49,9 +49,10 @@ enum TabViewItemIndices {
} // namespace
-#pragma mark Constrained window delegate
+using web_modal::WebContentsModalDialogManager;
-CollectedCookiesMac::CollectedCookiesMac(content::WebContents* web_contents) {
+CollectedCookiesMac::CollectedCookiesMac(content::WebContents* web_contents)
+ : web_contents_(web_contents) {
TabSpecificContentSettings* content_settings =
TabSpecificContentSettings::FromWebContents(web_contents);
registrar_.Add(this, chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN,
@@ -61,11 +62,8 @@ CollectedCookiesMac::CollectedCookiesMac(content::WebContents* web_contents) {
initWithWebContents:web_contents
collectedCookiesMac:this]);
- base::scoped_nsobject<CustomConstrainedWindowSheet> sheet(
- [[CustomConstrainedWindowSheet alloc]
- initWithCustomWindow:[sheet_controller_ window]]);
- window_.reset(new ConstrainedWindowMac(
- this, web_contents, sheet));
+ WebContentsModalDialogManager::FromWebContents(web_contents)
+ ->ShowModalDialog([sheet_controller_ window]);
}
CollectedCookiesMac::~CollectedCookiesMac() {
@@ -75,15 +73,12 @@ void CollectedCookiesMac::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
DCHECK(type == chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN);
- window_->CloseWebContentsModalDialog();
+ PerformClose();
}
void CollectedCookiesMac::PerformClose() {
- window_->CloseWebContentsModalDialog();
-}
-
-void CollectedCookiesMac::OnConstrainedWindowClosed(
- ConstrainedWindowMac* window) {
+ WebContentsModalDialogManager::FromWebContents(web_contents_)
+ ->WillClose([sheet_controller_ window]);
base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
tapted 2015/02/25 06:23:28 I'm not familiar with the CollectedCookies dialog.
}

Powered by Google App Engine
This is Rietveld 408576698