| Index: components/bubble/bubble_controller.h
|
| diff --git a/components/bubble/bubble_controller.h b/components/bubble/bubble_controller.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..02c70a8f216cfed706204555462cc61a496b3c71
|
| --- /dev/null
|
| +++ b/components/bubble/bubble_controller.h
|
| @@ -0,0 +1,55 @@
|
| +// Copyright 2015 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 COMPONENTS_BUBBLE_BUBBLE_CONTROLLER_H__
|
| +#define COMPONENTS_BUBBLE_BUBBLE_CONTROLLER_H__
|
| +
|
| +#include "base/callback.h"
|
| +
|
| +class BubbleDelegate;
|
| +class BubbleManager;
|
| +
|
| +enum BubbleCloseReason {
|
| + // Bubble was closed without any user interaction.
|
| + BUBBLE_CLOSE_IGNORE = 0,
|
| +
|
| + // User did not interact with the bubble, but changed tab.
|
| + BUBBLE_CLOSE_TABSWITCH,
|
| +
|
| + // User dismissed the bubble. (ESC, close, etc)
|
| + BUBBLE_CLOSE_CLOSE,
|
| +
|
| + // User selected the "Allow" option in a bubble.
|
| + BUBBLE_CLOSE_ALLOW,
|
| +
|
| + // User selected the "Deny" option in a bubble.
|
| + BUBBLE_CLOSE_DENY,
|
| +};
|
| +
|
| +class BubbleController {
|
| + public:
|
| + typedef base::Callback<scoped_ptr<BubbleController>(BubbleManager*,
|
| + BubbleDelegate*)> Factory;
|
| +
|
| + BubbleController(BubbleManager* manager, BubbleDelegate* delegate);
|
| + virtual ~BubbleController();
|
| +
|
| + virtual void Show();
|
| + virtual void Hide(BubbleCloseReason reason);
|
| +
|
| + virtual void UpdatePosition();
|
| +
|
| + bool IsOwnerOf(BubbleDelegate* delegate) { return delegate == delegate_; }
|
| +
|
| + static scoped_ptr<BubbleController> Create(BubbleManager* manager,
|
| + BubbleDelegate* delegate);
|
| + private:
|
| + // Weak.
|
| + BubbleManager* manager_;
|
| +
|
| + // Weak.
|
| + BubbleDelegate* delegate_;
|
| +};
|
| +
|
| +#endif // COMPONENTS_BUBBLE_BUBBLE_CONTROLLER_H__
|
|
|