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

Unified Diff: chrome/browser/ui/cocoa/profile_signin_confirmation_dialog_cocoa.mm

Issue 229163004: [Mac] Move profile related UI from cocoa/browser to cocoa/profiles (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: oops forgot a comment Created 6 years, 8 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/profile_signin_confirmation_dialog_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/profile_signin_confirmation_dialog_cocoa.mm b/chrome/browser/ui/cocoa/profile_signin_confirmation_dialog_cocoa.mm
deleted file mode 100644
index 30533ec23af44714e746902c0854ac7e41ddc362..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/cocoa/profile_signin_confirmation_dialog_cocoa.mm
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#import "chrome/browser/ui/cocoa/profile_signin_confirmation_dialog_cocoa.h"
-
-#include "base/message_loop/message_loop.h"
-#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_dialogs.h"
-#include "chrome/browser/ui/browser_finder.h"
-#include "chrome/browser/ui/browser_window.h"
-#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sheet.h"
-#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_window.h"
-#include "chrome/browser/ui/sync/profile_signin_confirmation_helper.h"
-#include "chrome/browser/ui/tabs/tab_strip_model.h"
-
-namespace {
-
-// static
-void ShowDialog(
- Browser* browser,
- content::WebContents* web_contents,
- Profile* profile,
- const std::string& username,
- ui::ProfileSigninConfirmationDelegate* delegate,
- bool offer_profile_creation) {
- // The dialog owns itself.
- new ProfileSigninConfirmationDialogCocoa(browser,
- web_contents,
- profile,
- username,
- delegate,
- offer_profile_creation);
-}
-
-} // namespace
-
-namespace chrome {
-
-// Declared in browser_dialogs.h
-void ShowProfileSigninConfirmationDialog(
- Browser* browser,
- content::WebContents* web_contents,
- Profile* profile,
- const std::string& username,
- ui::ProfileSigninConfirmationDelegate* delegate) {
- ui::CheckShouldPromptForNewProfile(
- profile,
- base::Bind(ShowDialog,
- browser, web_contents, profile, username, delegate));
-}
-
-} // namespace chrome
-
-ProfileSigninConfirmationDialogCocoa::ProfileSigninConfirmationDialogCocoa(
- Browser* browser,
- content::WebContents* web_contents,
- Profile* profile,
- const std::string& username,
- ui::ProfileSigninConfirmationDelegate* delegate,
- bool offer_profile_creation) {
- // Setup the dialog view controller.
- const base::Closure& closeDialogCallback =
- base::Bind(&ProfileSigninConfirmationDialogCocoa::Close,
- base::Unretained(this));
- controller_.reset(
- [[ProfileSigninConfirmationViewController alloc]
- initWithBrowser:browser
- username:username
- delegate:delegate
- closeDialogCallback:closeDialogCallback
- offerProfileCreation:offer_profile_creation]);
-
- // Setup the constrained window that will show the view.
- base::scoped_nsobject<NSWindow> window([[ConstrainedWindowCustomWindow alloc]
- initWithContentRect:[[controller_ view] bounds]]);
- [[window contentView] addSubview:[controller_ view]];
- base::scoped_nsobject<CustomConstrainedWindowSheet> sheet(
- [[CustomConstrainedWindowSheet alloc] initWithCustomWindow:window]);
- window_.reset(new ConstrainedWindowMac(this, web_contents, sheet));
-}
-
-ProfileSigninConfirmationDialogCocoa::~ProfileSigninConfirmationDialogCocoa() {
-}
-
-void ProfileSigninConfirmationDialogCocoa::Close() {
- window_->CloseWebContentsModalDialog();
-}
-
-void ProfileSigninConfirmationDialogCocoa::OnConstrainedWindowClosed(
- ConstrainedWindowMac* window) {
- base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
-}

Powered by Google App Engine
This is Rietveld 408576698