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 24 matching lines...) Expand all Loading... |
35 class Link; | 35 class Link; |
36 } | 36 } |
37 | 37 |
38 // A custom scrollable view implementation for the dialog. | 38 // A custom scrollable view implementation for the dialog. |
39 class CustomScrollableView : public views::View { | 39 class CustomScrollableView : public views::View { |
40 public: | 40 public: |
41 CustomScrollableView(); | 41 CustomScrollableView(); |
42 virtual ~CustomScrollableView(); | 42 virtual ~CustomScrollableView(); |
43 | 43 |
44 private: | 44 private: |
45 virtual void Layout() OVERRIDE; | 45 virtual void Layout() override; |
46 | 46 |
47 DISALLOW_COPY_AND_ASSIGN(CustomScrollableView); | 47 DISALLOW_COPY_AND_ASSIGN(CustomScrollableView); |
48 }; | 48 }; |
49 | 49 |
50 // Implements the extension installation dialog for TOOLKIT_VIEWS. | 50 // Implements the extension installation dialog for TOOLKIT_VIEWS. |
51 class ExtensionInstallDialogView : public views::DialogDelegateView, | 51 class ExtensionInstallDialogView : public views::DialogDelegateView, |
52 public views::LinkListener, | 52 public views::LinkListener, |
53 public views::ButtonListener { | 53 public views::ButtonListener { |
54 public: | 54 public: |
55 ExtensionInstallDialogView( | 55 ExtensionInstallDialogView( |
56 content::PageNavigator* navigator, | 56 content::PageNavigator* navigator, |
57 ExtensionInstallPrompt::Delegate* delegate, | 57 ExtensionInstallPrompt::Delegate* delegate, |
58 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt); | 58 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt); |
59 virtual ~ExtensionInstallDialogView(); | 59 virtual ~ExtensionInstallDialogView(); |
60 | 60 |
61 // Returns the interior ScrollView of the dialog. This allows us to inspect | 61 // Returns the interior ScrollView of the dialog. This allows us to inspect |
62 // the contents of the DialogView. | 62 // the contents of the DialogView. |
63 const views::ScrollView* scroll_view() const { return scroll_view_; } | 63 const views::ScrollView* scroll_view() const { return scroll_view_; } |
64 | 64 |
65 // Called when one of the child elements has expanded/collapsed. | 65 // Called when one of the child elements has expanded/collapsed. |
66 void ContentsChanged(); | 66 void ContentsChanged(); |
67 | 67 |
68 private: | 68 private: |
69 // views::DialogDelegateView: | 69 // views::DialogDelegateView: |
70 virtual int GetDialogButtons() const OVERRIDE; | 70 virtual int GetDialogButtons() const override; |
71 virtual base::string16 GetDialogButtonLabel( | 71 virtual base::string16 GetDialogButtonLabel( |
72 ui::DialogButton button) const OVERRIDE; | 72 ui::DialogButton button) const override; |
73 virtual int GetDefaultDialogButton() const OVERRIDE; | 73 virtual int GetDefaultDialogButton() const override; |
74 virtual bool Cancel() OVERRIDE; | 74 virtual bool Cancel() override; |
75 virtual bool Accept() OVERRIDE; | 75 virtual bool Accept() override; |
76 virtual ui::ModalType GetModalType() const OVERRIDE; | 76 virtual ui::ModalType GetModalType() const override; |
77 virtual base::string16 GetWindowTitle() const OVERRIDE; | 77 virtual base::string16 GetWindowTitle() const override; |
78 virtual void Layout() OVERRIDE; | 78 virtual void Layout() override; |
79 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 79 virtual gfx::Size GetPreferredSize() const override; |
80 virtual void ViewHierarchyChanged( | 80 virtual void ViewHierarchyChanged( |
81 const ViewHierarchyChangedDetails& details) OVERRIDE; | 81 const ViewHierarchyChangedDetails& details) override; |
82 | 82 |
83 // views::LinkListener: | 83 // views::LinkListener: |
84 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; | 84 virtual void LinkClicked(views::Link* source, int event_flags) override; |
85 | 85 |
86 // views::ButtonListener: | 86 // views::ButtonListener: |
87 virtual void ButtonPressed(views::Button* sender, | 87 virtual void ButtonPressed(views::Button* sender, |
88 const ui::Event& event) OVERRIDE; | 88 const ui::Event& event) override; |
89 | 89 |
90 // Experimental: Toggles inline permission explanations with an animation. | 90 // Experimental: Toggles inline permission explanations with an animation. |
91 void ToggleInlineExplanations(); | 91 void ToggleInlineExplanations(); |
92 | 92 |
93 // Initializes the dialog view, adding in permissions if they exist. | 93 // Initializes the dialog view, adding in permissions if they exist. |
94 void InitView(); | 94 void InitView(); |
95 | 95 |
96 // Adds permissions of |perm_type| to the dialog view if they exist. | 96 // Adds permissions of |perm_type| to the dialog view if they exist. |
97 bool AddPermissions(views::GridLayout* layout, | 97 bool AddPermissions(views::GridLayout* layout, |
98 ui::ResourceBundle& rb, | 98 ui::ResourceBundle& rb, |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 ExpandableContainerView(ExtensionInstallDialogView* owner, | 198 ExpandableContainerView(ExtensionInstallDialogView* owner, |
199 const base::string16& description, | 199 const base::string16& description, |
200 const PermissionDetails& details, | 200 const PermissionDetails& details, |
201 int horizontal_space, | 201 int horizontal_space, |
202 bool parent_bulleted, | 202 bool parent_bulleted, |
203 bool show_expand_link, | 203 bool show_expand_link, |
204 bool lighter_color_details); | 204 bool lighter_color_details); |
205 virtual ~ExpandableContainerView(); | 205 virtual ~ExpandableContainerView(); |
206 | 206 |
207 // views::View: | 207 // views::View: |
208 virtual void ChildPreferredSizeChanged(views::View* child) OVERRIDE; | 208 virtual void ChildPreferredSizeChanged(views::View* child) override; |
209 | 209 |
210 // views::ButtonListener: | 210 // views::ButtonListener: |
211 virtual void ButtonPressed(views::Button* sender, | 211 virtual void ButtonPressed(views::Button* sender, |
212 const ui::Event& event) OVERRIDE; | 212 const ui::Event& event) override; |
213 | 213 |
214 // views::LinkListener: | 214 // views::LinkListener: |
215 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; | 215 virtual void LinkClicked(views::Link* source, int event_flags) override; |
216 | 216 |
217 // gfx::AnimationDelegate: | 217 // gfx::AnimationDelegate: |
218 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; | 218 virtual void AnimationProgressed(const gfx::Animation* animation) override; |
219 virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE; | 219 virtual void AnimationEnded(const gfx::Animation* animation) override; |
220 | 220 |
221 // Expand/Collapse the detail section for this ExpandableContainerView. | 221 // Expand/Collapse the detail section for this ExpandableContainerView. |
222 void ToggleDetailLevel(); | 222 void ToggleDetailLevel(); |
223 | 223 |
224 // Expand the detail section without any animation. | 224 // Expand the detail section without any animation. |
225 // TODO(meacer): Remove once the experiment is completed. | 225 // TODO(meacer): Remove once the experiment is completed. |
226 void ExpandWithoutAnimation(); | 226 void ExpandWithoutAnimation(); |
227 | 227 |
228 private: | 228 private: |
229 // A view which displays all the details of an IssueAdviceInfoEntry. | 229 // A view which displays all the details of an IssueAdviceInfoEntry. |
230 class DetailsView : public views::View { | 230 class DetailsView : public views::View { |
231 public: | 231 public: |
232 explicit DetailsView(int horizontal_space, bool parent_bulleted, | 232 explicit DetailsView(int horizontal_space, bool parent_bulleted, |
233 bool lighter_color); | 233 bool lighter_color); |
234 virtual ~DetailsView() {} | 234 virtual ~DetailsView() {} |
235 | 235 |
236 // views::View: | 236 // views::View: |
237 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 237 virtual gfx::Size GetPreferredSize() const override; |
238 | 238 |
239 void AddDetail(const base::string16& detail); | 239 void AddDetail(const base::string16& detail); |
240 | 240 |
241 // Animates this to be a height proportional to |state|. | 241 // Animates this to be a height proportional to |state|. |
242 void AnimateToState(double state); | 242 void AnimateToState(double state); |
243 | 243 |
244 private: | 244 private: |
245 views::GridLayout* layout_; | 245 views::GridLayout* layout_; |
246 double state_; | 246 double state_; |
247 | 247 |
(...skipping 24 matching lines...) Expand all Loading... |
272 | 272 |
273 DISALLOW_COPY_AND_ASSIGN(ExpandableContainerView); | 273 DISALLOW_COPY_AND_ASSIGN(ExpandableContainerView); |
274 }; | 274 }; |
275 | 275 |
276 void ShowExtensionInstallDialogImpl( | 276 void ShowExtensionInstallDialogImpl( |
277 const ExtensionInstallPrompt::ShowParams& show_params, | 277 const ExtensionInstallPrompt::ShowParams& show_params, |
278 ExtensionInstallPrompt::Delegate* delegate, | 278 ExtensionInstallPrompt::Delegate* delegate, |
279 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt); | 279 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt); |
280 | 280 |
281 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_INSTALL_DIALOG_VIEW_H_ | 281 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_INSTALL_DIALOG_VIEW_H_ |
OLD | NEW |