Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / cocoa / website_settings / split_block_button.h
1 // Copyright 2014 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_WEBSITE_SETTINGS_SPLIT_BLOCK_BUTTON_
6 #define CHROME_BROWSER_UI_COCOA_WEBSITE_SETTINGS_SPLIT_BLOCK_BUTTON_
7
8 #import <Cocoa/Cocoa.h>
9
10 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_button.h"
11 #include "grit/generated_resources.h"
12 #include "ui/base/models/simple_menu_model.h"
13
14 @class SplitButtonPopUpCell;
15 @class SplitButtonTitleCell;
16
17 // Block ('deny') button for the permissions bubble.  Subclassed from
18 // ConstrainedWindowButton, so that it shares styling, but contains two cells
19 // instead of just one.  The left cell behaves as a normal button, and when
20 // clicked, calls the button's |action| on its |target|.  The right cell behaves
21 // as a NSPopUpButtonCell, and implements a single-item menu.
22 @interface SplitBlockButton : ConstrainedWindowButton {
23  @private
24   base::scoped_nsobject<SplitButtonTitleCell> leftCell_;
25   base::scoped_nsobject<SplitButtonPopUpCell> rightCell_;
26
27   ui::ScopedCrTrackingArea leftTrackingArea_;
28   ui::ScopedCrTrackingArea rightTrackingArea_;
29 }
30
31 // Designated initializer.
32 - (id)initWithMenuDelegate:(ui::SimpleMenuModel::Delegate*)menuDelegate;
33
34 @end
35
36 #endif  // CHROME_BROWSER_UI_COCOA_WEBSITE_SETTINGS_SPLIT_BLOCK_BUTTON_