OLD | NEW |
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" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 void ContentsChanged(); | 62 void ContentsChanged(); |
63 | 63 |
64 private: | 64 private: |
65 // views::DialogDelegateView: | 65 // views::DialogDelegateView: |
66 virtual int GetDialogButtons() const OVERRIDE; | 66 virtual int GetDialogButtons() const OVERRIDE; |
67 virtual base::string16 GetDialogButtonLabel( | 67 virtual base::string16 GetDialogButtonLabel( |
68 ui::DialogButton button) const OVERRIDE; | 68 ui::DialogButton button) const OVERRIDE; |
69 virtual int GetDefaultDialogButton() const OVERRIDE; | 69 virtual int GetDefaultDialogButton() const OVERRIDE; |
70 virtual bool Cancel() OVERRIDE; | 70 virtual bool Cancel() OVERRIDE; |
71 virtual bool Accept() OVERRIDE; | 71 virtual bool Accept() OVERRIDE; |
| 72 virtual void OnClosed() OVERRIDE; |
72 virtual ui::ModalType GetModalType() const OVERRIDE; | 73 virtual ui::ModalType GetModalType() const OVERRIDE; |
73 virtual base::string16 GetWindowTitle() const OVERRIDE; | 74 virtual base::string16 GetWindowTitle() const OVERRIDE; |
74 virtual void Layout() OVERRIDE; | 75 virtual void Layout() OVERRIDE; |
75 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 76 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
76 virtual void ViewHierarchyChanged( | 77 virtual void ViewHierarchyChanged( |
77 const ViewHierarchyChangedDetails& details) OVERRIDE; | 78 const ViewHierarchyChangedDetails& details) OVERRIDE; |
78 | 79 |
79 // views::LinkListener: | 80 // views::LinkListener: |
80 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; | 81 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; |
81 | 82 |
(...skipping 23 matching lines...) Expand all Loading... |
105 return prompt_->type() == ExtensionInstallPrompt::EXTERNAL_INSTALL_PROMPT; | 106 return prompt_->type() == ExtensionInstallPrompt::EXTERNAL_INSTALL_PROMPT; |
106 } | 107 } |
107 | 108 |
108 // Updates the histogram that holds installation accepted/aborted data. | 109 // Updates the histogram that holds installation accepted/aborted data. |
109 void UpdateInstallResultHistogram(bool accepted) const; | 110 void UpdateInstallResultHistogram(bool accepted) const; |
110 | 111 |
111 // Updates the histogram that holds data about whether "Show details" or | 112 // Updates the histogram that holds data about whether "Show details" or |
112 // "Show permissions" links were shown and/or clicked. | 113 // "Show permissions" links were shown and/or clicked. |
113 void UpdateLinkActionHistogram(int action_type) const; | 114 void UpdateLinkActionHistogram(int action_type) const; |
114 | 115 |
| 116 // Updates the install result histogram and notifies the |delegate_| when the |
| 117 // install has been cancelled by the user. |
| 118 void OnInstallAborted(); |
| 119 |
115 content::PageNavigator* navigator_; | 120 content::PageNavigator* navigator_; |
116 ExtensionInstallPrompt::Delegate* delegate_; | 121 ExtensionInstallPrompt::Delegate* delegate_; |
117 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt_; | 122 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt_; |
118 | 123 |
119 // The scroll view containing all the details for the dialog (including all | 124 // The scroll view containing all the details for the dialog (including all |
120 // collapsible/expandable sections). | 125 // collapsible/expandable sections). |
121 views::ScrollView* scroll_view_; | 126 views::ScrollView* scroll_view_; |
122 | 127 |
123 // The container view for the scroll view. | 128 // The container view for the scroll view. |
124 CustomScrollableView* scrollable_; | 129 CustomScrollableView* scrollable_; |
(...skipping 17 matching lines...) Expand all Loading... |
142 typedef std::vector<ExpandableContainerView*> InlineExplanations; | 147 typedef std::vector<ExpandableContainerView*> InlineExplanations; |
143 InlineExplanations inline_explanations_; | 148 InlineExplanations inline_explanations_; |
144 | 149 |
145 // Experimental: Number of unchecked checkboxes in the permission list. | 150 // Experimental: Number of unchecked checkboxes in the permission list. |
146 // If this becomes zero, the accept button is enabled, otherwise disabled. | 151 // If this becomes zero, the accept button is enabled, otherwise disabled. |
147 int unchecked_boxes_; | 152 int unchecked_boxes_; |
148 | 153 |
149 // ExperienceSampling: Track this UI event. | 154 // ExperienceSampling: Track this UI event. |
150 scoped_ptr<extensions::ExperienceSamplingEvent> sampling_event_; | 155 scoped_ptr<extensions::ExperienceSamplingEvent> sampling_event_; |
151 | 156 |
| 157 // Set to true once the user's selection has been received and the |
| 158 // |delegate_| has been notified. |
| 159 bool handled_result_; |
| 160 |
152 DISALLOW_COPY_AND_ASSIGN(ExtensionInstallDialogView); | 161 DISALLOW_COPY_AND_ASSIGN(ExtensionInstallDialogView); |
153 }; | 162 }; |
154 | 163 |
155 // A simple view that prepends a view with a bullet with the help of a grid | 164 // A simple view that prepends a view with a bullet with the help of a grid |
156 // layout. | 165 // layout. |
157 class BulletedView : public views::View { | 166 class BulletedView : public views::View { |
158 public: | 167 public: |
159 explicit BulletedView(views::View* view); | 168 explicit BulletedView(views::View* view); |
160 private: | 169 private: |
161 DISALLOW_COPY_AND_ASSIGN(BulletedView); | 170 DISALLOW_COPY_AND_ASSIGN(BulletedView); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 | 263 |
255 DISALLOW_COPY_AND_ASSIGN(ExpandableContainerView); | 264 DISALLOW_COPY_AND_ASSIGN(ExpandableContainerView); |
256 }; | 265 }; |
257 | 266 |
258 void ShowExtensionInstallDialogImpl( | 267 void ShowExtensionInstallDialogImpl( |
259 const ExtensionInstallPrompt::ShowParams& show_params, | 268 const ExtensionInstallPrompt::ShowParams& show_params, |
260 ExtensionInstallPrompt::Delegate* delegate, | 269 ExtensionInstallPrompt::Delegate* delegate, |
261 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt); | 270 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt); |
262 | 271 |
263 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_INSTALL_DIALOG_VIEW_H_ | 272 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_INSTALL_DIALOG_VIEW_H_ |
OLD | NEW |