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

Side by Side Diff: chrome/browser/ui/views/extensions/extension_install_dialog_view.h

Issue 660643002: [Refactor] Move creating a browser if necessary to ExtensionInstallDialogView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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_EXTENSIONS_EXTENSION_INSTALL_DIALOG_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_INSTALL_DIALOG_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_INSTALL_DIALOG_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_INSTALL_DIALOG_VIEW_H_
7 7
8 #include "chrome/browser/extensions/extension_install_prompt.h" 8 #include "chrome/browser/extensions/extension_install_prompt.h"
9 #include "ui/gfx/animation/animation_delegate.h" 9 #include "ui/gfx/animation/animation_delegate.h"
10 #include "ui/gfx/animation/slide_animation.h" 10 #include "ui/gfx/animation/slide_animation.h"
11 #include "ui/views/controls/button/button.h" 11 #include "ui/views/controls/button/button.h"
12 #include "ui/views/controls/link_listener.h" 12 #include "ui/views/controls/link_listener.h"
13 #include "ui/views/view.h" 13 #include "ui/views/view.h"
14 #include "ui/views/window/dialog_delegate.h" 14 #include "ui/views/window/dialog_delegate.h"
15 15
16 typedef std::vector<base::string16> PermissionDetails; 16 typedef std::vector<base::string16> PermissionDetails;
17 class ExpandableContainerView; 17 class ExpandableContainerView;
18 class Profile;
18 19
19 namespace content { 20 namespace content {
20 class PageNavigator; 21 class PageNavigator;
21 } 22 }
22 23
23 namespace extensions { 24 namespace extensions {
24 class ExperienceSamplingEvent; 25 class ExperienceSamplingEvent;
25 } 26 }
26 27
27 namespace ui { 28 namespace ui {
(...skipping 18 matching lines...) Expand all
46 47
47 DISALLOW_COPY_AND_ASSIGN(CustomScrollableView); 48 DISALLOW_COPY_AND_ASSIGN(CustomScrollableView);
48 }; 49 };
49 50
50 // Implements the extension installation dialog for TOOLKIT_VIEWS. 51 // Implements the extension installation dialog for TOOLKIT_VIEWS.
51 class ExtensionInstallDialogView : public views::DialogDelegateView, 52 class ExtensionInstallDialogView : public views::DialogDelegateView,
52 public views::LinkListener, 53 public views::LinkListener,
53 public views::ButtonListener { 54 public views::ButtonListener {
54 public: 55 public:
55 ExtensionInstallDialogView( 56 ExtensionInstallDialogView(
57 Profile* profile,
56 content::PageNavigator* navigator, 58 content::PageNavigator* navigator,
57 ExtensionInstallPrompt::Delegate* delegate, 59 ExtensionInstallPrompt::Delegate* delegate,
58 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt); 60 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt);
59 virtual ~ExtensionInstallDialogView(); 61 virtual ~ExtensionInstallDialogView();
60 62
61 // Returns the interior ScrollView of the dialog. This allows us to inspect 63 // Returns the interior ScrollView of the dialog. This allows us to inspect
62 // the contents of the DialogView. 64 // the contents of the DialogView.
63 const views::ScrollView* scroll_view() const { return scroll_view_; } 65 const views::ScrollView* scroll_view() const { return scroll_view_; }
64 66
65 // Called when one of the child elements has expanded/collapsed. 67 // Called when one of the child elements has expanded/collapsed.
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 return prompt_->type() == ExtensionInstallPrompt::EXTERNAL_INSTALL_PROMPT; 121 return prompt_->type() == ExtensionInstallPrompt::EXTERNAL_INSTALL_PROMPT;
120 } 122 }
121 123
122 // Updates the histogram that holds installation accepted/aborted data. 124 // Updates the histogram that holds installation accepted/aborted data.
123 void UpdateInstallResultHistogram(bool accepted) const; 125 void UpdateInstallResultHistogram(bool accepted) const;
124 126
125 // Updates the histogram that holds data about whether "Show details" or 127 // Updates the histogram that holds data about whether "Show details" or
126 // "Show permissions" links were shown and/or clicked. 128 // "Show permissions" links were shown and/or clicked.
127 void UpdateLinkActionHistogram(int action_type) const; 129 void UpdateLinkActionHistogram(int action_type) const;
128 130
131 Profile* profile_;
129 content::PageNavigator* navigator_; 132 content::PageNavigator* navigator_;
130 ExtensionInstallPrompt::Delegate* delegate_; 133 ExtensionInstallPrompt::Delegate* delegate_;
131 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt_; 134 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt_;
132 135
133 // The scroll view containing all the details for the dialog (including all 136 // The scroll view containing all the details for the dialog (including all
134 // collapsible/expandable sections). 137 // collapsible/expandable sections).
135 views::ScrollView* scroll_view_; 138 views::ScrollView* scroll_view_;
136 139
137 // The container view for the scroll view. 140 // The container view for the scroll view.
138 CustomScrollableView* scrollable_; 141 CustomScrollableView* scrollable_;
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 275
273 DISALLOW_COPY_AND_ASSIGN(ExpandableContainerView); 276 DISALLOW_COPY_AND_ASSIGN(ExpandableContainerView);
274 }; 277 };
275 278
276 void ShowExtensionInstallDialogImpl( 279 void ShowExtensionInstallDialogImpl(
277 const ExtensionInstallPrompt::ShowParams& show_params, 280 const ExtensionInstallPrompt::ShowParams& show_params,
278 ExtensionInstallPrompt::Delegate* delegate, 281 ExtensionInstallPrompt::Delegate* delegate,
279 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt); 282 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt);
280 283
281 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_INSTALL_DIALOG_VIEW_H_ 284 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_INSTALL_DIALOG_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698