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" |
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 | 18 |
19 namespace content { | 19 namespace content { |
20 class PageNavigator; | 20 class PageNavigator; |
21 } | 21 } |
22 | 22 |
23 namespace extensions { | 23 namespace extensions { |
24 class ExperienceSamplingEvent; | 24 class ExperienceSamplingEvent; |
25 } | 25 } |
26 | 26 |
| 27 namespace ui { |
| 28 class ResourceBundle; |
| 29 } |
| 30 |
27 namespace views { | 31 namespace views { |
28 class GridLayout; | 32 class GridLayout; |
29 class ImageButton; | 33 class ImageButton; |
30 class Label; | 34 class Label; |
31 class Link; | 35 class Link; |
32 } | 36 } |
33 | 37 |
34 // A custom scrollable view implementation for the dialog. | 38 // A custom scrollable view implementation for the dialog. |
35 class CustomScrollableView : public views::View { | 39 class CustomScrollableView : public views::View { |
36 public: | 40 public: |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // views::LinkListener: | 83 // views::LinkListener: |
80 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; | 84 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; |
81 | 85 |
82 // views::ButtonListener: | 86 // views::ButtonListener: |
83 virtual void ButtonPressed(views::Button* sender, | 87 virtual void ButtonPressed(views::Button* sender, |
84 const ui::Event& event) OVERRIDE; | 88 const ui::Event& event) OVERRIDE; |
85 | 89 |
86 // Experimental: Toggles inline permission explanations with an animation. | 90 // Experimental: Toggles inline permission explanations with an animation. |
87 void ToggleInlineExplanations(); | 91 void ToggleInlineExplanations(); |
88 | 92 |
| 93 // Initializes the dialog view, adding in permissions if they exist. |
| 94 void InitView(); |
| 95 |
| 96 // Adds permissions of |perm_type| to the dialog view if they exist. |
| 97 bool AddPermissions(views::GridLayout* layout, |
| 98 ui::ResourceBundle& rb, |
| 99 int column_set_id, |
| 100 int left_column_width, |
| 101 ExtensionInstallPrompt::PermissionsType perm_type); |
| 102 |
89 // Creates a layout consisting of dialog header, extension name and icon. | 103 // Creates a layout consisting of dialog header, extension name and icon. |
90 views::GridLayout* CreateLayout( | 104 views::GridLayout* CreateLayout( |
91 views::View* parent, | 105 views::View* parent, |
92 int left_column_width, | 106 int left_column_width, |
93 int column_set_id, | 107 int column_set_id, |
94 bool single_detail_row) const; | 108 bool single_detail_row) const; |
95 | 109 |
96 bool is_inline_install() const { | 110 bool is_inline_install() const { |
97 return prompt_->type() == ExtensionInstallPrompt::INLINE_INSTALL_PROMPT; | 111 return prompt_->type() == ExtensionInstallPrompt::INLINE_INSTALL_PROMPT; |
98 } | 112 } |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 | 272 |
259 DISALLOW_COPY_AND_ASSIGN(ExpandableContainerView); | 273 DISALLOW_COPY_AND_ASSIGN(ExpandableContainerView); |
260 }; | 274 }; |
261 | 275 |
262 void ShowExtensionInstallDialogImpl( | 276 void ShowExtensionInstallDialogImpl( |
263 const ExtensionInstallPrompt::ShowParams& show_params, | 277 const ExtensionInstallPrompt::ShowParams& show_params, |
264 ExtensionInstallPrompt::Delegate* delegate, | 278 ExtensionInstallPrompt::Delegate* delegate, |
265 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt); | 279 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt); |
266 | 280 |
267 #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 |