diff options
author | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-09 18:10:41 +0000 |
---|---|---|
committer | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-09 18:10:41 +0000 |
commit | 9e6db27702e27da1e888d89bfc7dcfac72005d57 (patch) | |
tree | 1b18cdb898d11de97c36c010b51b3dcac9ebcd93 | |
parent | b7e45c0fd0e8147ee8389d7fd4b6e64a436fb09f (diff) | |
download | chromium_src-9e6db27702e27da1e888d89bfc7dcfac72005d57.zip chromium_src-9e6db27702e27da1e888d89bfc7dcfac72005d57.tar.gz chromium_src-9e6db27702e27da1e888d89bfc7dcfac72005d57.tar.bz2 |
Remove chrome/browser/ui/cocoa/instant_confirm_window_controller*
BUG=73011
TEST=Mac full build goes green
Review URL: http://codereview.chromium.org/6612038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77487 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/ui/cocoa/instant_confirm_window_controller.h | 43 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/instant_confirm_window_controller.mm | 76 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/instant_confirm_window_controller_unittest.mm | 36 | ||||
-rw-r--r-- | chrome/chrome_browser.gypi | 2 | ||||
-rw-r--r-- | chrome/chrome_tests.gypi | 1 |
5 files changed, 0 insertions, 158 deletions
diff --git a/chrome/browser/ui/cocoa/instant_confirm_window_controller.h b/chrome/browser/ui/cocoa/instant_confirm_window_controller.h deleted file mode 100644 index a0f0c2f..0000000 --- a/chrome/browser/ui/cocoa/instant_confirm_window_controller.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 2010 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. - -#ifndef CHROME_BROWSER_UI_COCOA_INSTANT_CONFIRM_WINDOW_CONTROLLER_H_ -#define CHROME_BROWSER_UI_COCOA_INSTANT_CONFIRM_WINDOW_CONTROLLER_H_ -#pragma once - -#import <Cocoa/Cocoa.h> - -#import "base/mac/cocoa_protocols.h" - -class Profile; - -// This controller manages a dialog that informs the user about Instant search. -// The recommended API is to not use this class directly, but instead to use -// the functions in //chrome/browser/instant/instant_confirm_dialog.h: -// void ShowInstantConfirmDialog[IfNecessary](gfx::NativeWindow* parent, ...) -// Which will attach the window to |parent| as a sheet. -@interface InstantConfirmWindowController : NSWindowController<NSWindowDelegate> -{ - @private - // The long description about Instant that needs to be sized-to-fit. - IBOutlet NSTextField* description_; - - Profile* profile_; // weak -} - -// Designated initializer. The controller will release itself on window close. -- (id)initWithProfile:(Profile*)profile; - -// Action for the "Learn more" link. -- (IBAction)learnMore:(id)sender; - -// The user has opted in to Instant. This enables the Instant preference. -- (IBAction)ok:(id)sender; - -// Closes the sheet without altering the preference value. -- (IBAction)cancel:(id)sender; - -@end - -#endif // CHROME_BROWSER_UI_COCOA_INSTANT_CONFIRM_WINDOW_CONTROLLER_H_ diff --git a/chrome/browser/ui/cocoa/instant_confirm_window_controller.mm b/chrome/browser/ui/cocoa/instant_confirm_window_controller.mm deleted file mode 100644 index c98d3f0c..0000000 --- a/chrome/browser/ui/cocoa/instant_confirm_window_controller.mm +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) 2010 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/instant_confirm_window_controller.h" - -#include "base/logging.h" -#include "base/mac/mac_util.h" -#include "chrome/browser/instant/instant_confirm_dialog.h" -#include "chrome/browser/instant/instant_controller.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/options/show_options_url.h" -#include "googleurl/src/gurl.h" -#import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" -#include "ui/gfx/native_widget_types.h" - -namespace browser { - -void ShowInstantConfirmDialog(gfx::NativeWindow parent, Profile* profile) { - InstantConfirmWindowController* controller = - [[InstantConfirmWindowController alloc] initWithProfile:profile]; - [NSApp beginSheet:[controller window] - modalForWindow:parent - modalDelegate:nil - didEndSelector:NULL - contextInfo:NULL]; -} - -} // namespace browser - -@implementation InstantConfirmWindowController - -- (id)initWithProfile:(Profile*)profile { - NSString* nibPath = [base::mac::MainAppBundle() - pathForResource:@"InstantConfirm" - ofType:@"nib"]; - if ((self = [super initWithWindowNibPath:nibPath owner:self])) { - profile_ = profile; - } - return self; -} - -- (void)awakeFromNib { - DCHECK([self window]); - DCHECK_EQ(self, [[self window] delegate]); - - CGFloat delta = [GTMUILocalizerAndLayoutTweaker sizeToFitFixedWidthTextField: - description_]; - NSRect descriptionFrame = [description_ frame]; - descriptionFrame.origin.y -= delta; - [description_ setFrame:descriptionFrame]; - - NSRect frame = [[self window] frame]; - frame.size.height += delta; - [[self window] setFrame:frame display:YES]; -} - -- (void)windowWillClose:(NSNotification*)notif { - [self autorelease]; -} - -- (IBAction)learnMore:(id)sender { - browser::ShowOptionsURL(profile_, browser::InstantLearnMoreURL()); -} - -- (IBAction)ok:(id)sender { - InstantController::Enable(profile_); - [self cancel:sender]; -} - -- (IBAction)cancel:(id)sender { - [NSApp endSheet:[self window]]; - [[self window] close]; -} - -@end diff --git a/chrome/browser/ui/cocoa/instant_confirm_window_controller_unittest.mm b/chrome/browser/ui/cocoa/instant_confirm_window_controller_unittest.mm deleted file mode 100644 index 71d8c9e..0000000 --- a/chrome/browser/ui/cocoa/instant_confirm_window_controller_unittest.mm +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) 2010 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/instant_confirm_window_controller.h" - -#include "chrome/browser/instant/instant_confirm_dialog.h" -#import "chrome/browser/ui/cocoa/browser_test_helper.h" -#import "chrome/browser/ui/cocoa/cocoa_test_helper.h" - -namespace { - -class InstantConfirmWindowControllerTest : public CocoaTest { - public: - InstantConfirmWindowControllerTest() : controller_(nil) {} - - BrowserTestHelper helper_; - InstantConfirmWindowController* controller_; // Weak. Owns self. -}; - -TEST_F(InstantConfirmWindowControllerTest, Init) { - controller_ = - [[InstantConfirmWindowController alloc] initWithProfile: - helper_.profile()]; - EXPECT_TRUE([controller_ window]); - [controller_ release]; -} - -TEST_F(InstantConfirmWindowControllerTest, Show) { - browser::ShowInstantConfirmDialog(test_window(), helper_.profile()); - controller_ = [[test_window() attachedSheet] windowController]; - EXPECT_TRUE(controller_); - [controller_ cancel:nil]; -} - -} // namespace diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index b8d61f7..ebbc8da 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -2303,8 +2303,6 @@ 'browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.h', 'browser/ui/cocoa/infobars/mock_link_infobar_delegate.cc', 'browser/ui/cocoa/infobars/mock_link_infobar_delegate.h', - 'browser/ui/cocoa/instant_confirm_window_controller.h', - 'browser/ui/cocoa/instant_confirm_window_controller.mm', 'browser/ui/cocoa/js_modal_dialog_cocoa.h', 'browser/ui/cocoa/js_modal_dialog_cocoa.mm', 'browser/ui/cocoa/keystone_infobar.h', diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index 909645b..cf55d7f 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -1616,7 +1616,6 @@ 'browser/ui/cocoa/infobars/infobar_container_controller_unittest.mm', 'browser/ui/cocoa/infobars/infobar_controller_unittest.mm', 'browser/ui/cocoa/infobars/infobar_gradient_view_unittest.mm', - 'browser/ui/cocoa/instant_confirm_window_controller_unittest.mm', 'browser/ui/cocoa/location_bar/autocomplete_text_field_cell_unittest.mm', 'browser/ui/cocoa/location_bar/autocomplete_text_field_editor_unittest.mm', 'browser/ui/cocoa/location_bar/autocomplete_text_field_unittest.mm', |