Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / browser / ui / views / conflicting_module_view_win.h
blobfa4e49691b85a65b551420be69fe3c571a1c7af2
1 // Copyright (c) 2013 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.
5 #ifndef CHROME_BROWSER_UI_VIEWS_CONFLICTING_MODULE_VIEW_WIN_H_
6 #define CHROME_BROWSER_UI_VIEWS_CONFLICTING_MODULE_VIEW_WIN_H_
8 #include "content/public/browser/notification_observer.h"
9 #include "content/public/browser/notification_registrar.h"
10 #include "ui/views/bubble/bubble_delegate.h"
11 #include "ui/views/controls/button/button.h"
12 #include "url/gurl.h"
14 class Browser;
16 namespace views {
17 class Label;
18 class LabelButton;
21 // This is the class that implements the UI for the bubble showing that there
22 // is a 3rd party module loaded that conflicts with Chrome.
23 class ConflictingModuleView : public views::BubbleDelegateView,
24 public views::ButtonListener,
25 public content::NotificationObserver {
26 public:
27 ConflictingModuleView(views::View* anchor_view,
28 Browser* browser,
29 const GURL& help_center_url);
31 // Show the Disabled Extension bubble, if needed.
32 static void MaybeShow(Browser* browser, views::View* anchor_view);
34 private:
35 ~ConflictingModuleView() override;
37 // Shows the bubble and updates the counter for how often it has been shown.
38 void ShowBubble();
40 // Dismiss and make sure the bubble is not shown again. This bubble is a
41 // single-appearance bubble.
42 void DismissBubble();
44 // views::BubbleDelegateView implementation:
45 void Init() override;
47 // views::ButtonListener implementation.
48 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
50 // views::View implementation.
51 void GetAccessibleState(ui::AXViewState* state) override;
52 void ViewHierarchyChanged(
53 const ViewHierarchyChangedDetails& details) override;
55 // content::NotificationObserver implementation.
56 void Observe(
57 int type,
58 const content::NotificationSource& source,
59 const content::NotificationDetails& details) override;
61 Browser* browser_;
63 content::NotificationRegistrar registrar_;
65 // The headline, labels and buttons on the bubble.
66 views::Label* explanation_;
67 views::LabelButton* learn_more_button_;
68 views::LabelButton* not_now_button_;
70 // The link to the help center for this conflict.
71 GURL help_center_url_;
73 DISALLOW_COPY_AND_ASSIGN(ConflictingModuleView);
76 #endif // CHROME_BROWSER_UI_VIEWS_CONFLICTING_MODULE_VIEW_WIN_H_