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

Side by Side Diff: chrome/browser/ui/views/website_settings/permissions_bubble_view.h

Issue 1251633002: Add BubbleManager to manage bubbles and ChromeBubbleManager for events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Apply Feedback Created 5 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSIONS_BUBBLE_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSIONS_BUBBLE_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSIONS_BUBBLE_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSIONS_BUBBLE_VIEW_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "chrome/browser/ui/website_settings/permission_bubble_view.h" 12 #include "components/bubble/bubble_ui.h"
13 #include "ui/views/bubble/bubble_border.h" 13 #include "ui/views/bubble/bubble_border.h"
14 14
15 namespace views { 15 namespace views {
16 class View; 16 class View;
17 } 17 }
18 18
19 class Browser; 19 class Browser;
20 class PermissionBubbleManager;
20 class PermissionsBubbleDelegateView; 21 class PermissionsBubbleDelegateView;
21 22
22 class PermissionBubbleViewViews : public PermissionBubbleView { 23 class PermissionBubbleViewViews : public BubbleUI {
23 public: 24 public:
24 explicit PermissionBubbleViewViews(Browser* browser); 25 explicit PermissionBubbleViewViews(PermissionBubbleManager* manager);
25 ~PermissionBubbleViewViews() override; 26 ~PermissionBubbleViewViews() override;
26 27
27 // PermissionBubbleView: 28 // BubbleUI
msw 2015/08/13 03:37:21 nit: trailing colon
28 void SetDelegate(Delegate* delegate) override; 29 void Show() override;
29 void Show(const std::vector<PermissionBubbleRequest*>& requests,
30 const std::vector<bool>& accept_state) override;
31 bool CanAcceptRequestUpdate() override;
32 void Hide() override; 30 void Hide() override;
33 bool IsVisible() override;
34 void UpdateAnchorPosition() override; 31 void UpdateAnchorPosition() override;
35 gfx::NativeWindow GetNativeWindow() override; 32 bool CanAcceptUpdate() const override;
36 33
34 // Callbacks from UI:
37 void Closing(); 35 void Closing();
38 void Toggle(int index, bool value); 36 void Toggle(int index, bool value);
39 void Accept(); 37 void Accept();
40 void Deny(); 38 void Deny();
41 39
42 private: 40 private:
43 views::View* GetAnchorView(); 41 views::View* GetAnchorView();
44 views::BubbleBorder::Arrow GetAnchorArrow(); 42 views::BubbleBorder::Arrow GetAnchorArrow();
45 43
46 Browser* browser_; 44 PermissionBubbleManager* manager_; // Weak.
47 Delegate* delegate_; 45 Browser* browser_; // Weak.
48 PermissionsBubbleDelegateView* bubble_delegate_; 46 PermissionsBubbleDelegateView* bubble_delegate_; // Weak.
49 47
50 DISALLOW_COPY_AND_ASSIGN(PermissionBubbleViewViews); 48 DISALLOW_COPY_AND_ASSIGN(PermissionBubbleViewViews);
51 }; 49 };
52 50
53 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSIONS_BUBBLE_VIEW_H_ 51 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSIONS_BUBBLE_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698