Home | History | Annotate | Download | only in location_bar
      1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_INSTANT_OPT_IN_CONTROLLER_H_
      6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_INSTANT_OPT_IN_CONTROLLER_H_
      7 #pragma once
      8 
      9 #import <Cocoa/Cocoa.h>
     10 
     11 class Profile;
     12 
     13 // This delegate receives callbacks from the InstantOptInController when the OK
     14 // and Cancel buttons are pushed.
     15 class InstantOptInControllerDelegate {
     16  public:
     17   virtual void UserPressedOptIn(bool opt_in) = 0;
     18 
     19  protected:
     20   virtual ~InstantOptInControllerDelegate() {}
     21 };
     22 
     23 // Manages an instant opt-in view, which is part of the omnibox popup.
     24 @interface InstantOptInController : NSViewController {
     25  @private
     26   InstantOptInControllerDelegate* delegate_;  // weak
     27 
     28   // Needed in order to localize text and resize to fit.
     29   IBOutlet NSButton* okButton_;
     30   IBOutlet NSButton* cancelButton_;
     31   IBOutlet NSTextField* label_;
     32 }
     33 
     34 // Designated initializer.
     35 - (id)initWithDelegate:(InstantOptInControllerDelegate*)delegate;
     36 
     37 // Button actions.
     38 - (IBAction)ok:(id)sender;
     39 - (IBAction)cancel:(id)sender;
     40 
     41 @end
     42 
     43 #endif  // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_INSTANT_OPT_IN_CONTROLLER_H_
     44