OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_WEBSITE_SETTINGS_PERMISSION_SELECTOR_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSION_SELECTOR_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSION_SELECTOR_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSION_SELECTOR_VIEW_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 namespace views { | 25 namespace views { |
26 class ImageView; | 26 class ImageView; |
27 class MenuRunner; | 27 class MenuRunner; |
28 } | 28 } |
29 | 29 |
30 // A custom view for selecting a permission setting for the given permission | 30 // A custom view for selecting a permission setting for the given permission |
31 // |type|. | 31 // |type|. |
32 class PermissionSelectorView : public views::View { | 32 class PermissionSelectorView : public views::View { |
33 public: | 33 public: |
34 PermissionSelectorView(const GURL& url, | 34 PermissionSelectorView(const GURL& url, |
35 const WebsiteSettingsUI::PermissionInfo& permission); | 35 const WebsiteSettingsUI::PermissionInfo& permission, |
| 36 bool is_incognito); |
36 | 37 |
37 void AddObserver(PermissionSelectorViewObserver* observer); | 38 void AddObserver(PermissionSelectorViewObserver* observer); |
38 | 39 |
39 void PermissionChanged(const WebsiteSettingsUI::PermissionInfo& permission); | 40 void PermissionChanged(const WebsiteSettingsUI::PermissionInfo& permission); |
40 | 41 |
41 protected: | 42 protected: |
42 // Overridden from views::View. | 43 // Overridden from views::View. |
43 void ChildPreferredSizeChanged(View* child) override; | 44 void ChildPreferredSizeChanged(View* child) override; |
44 | 45 |
45 private: | 46 private: |
46 ~PermissionSelectorView() override; | 47 ~PermissionSelectorView() override; |
47 | 48 |
| 49 bool is_incognito_; |
| 50 |
48 // Model for the permission's menu. | 51 // Model for the permission's menu. |
49 scoped_ptr<PermissionMenuModel> menu_model_; | 52 scoped_ptr<PermissionMenuModel> menu_model_; |
50 | 53 |
51 views::ImageView* icon_; // Owned by the views hierachy. | 54 views::ImageView* icon_; // Owned by the views hierachy. |
52 internal::PermissionMenuButton* menu_button_; // Owned by the views hierachy. | 55 internal::PermissionMenuButton* menu_button_; // Owned by the views hierachy. |
53 | 56 |
54 base::ObserverList<PermissionSelectorViewObserver, false> observer_list_; | 57 base::ObserverList<PermissionSelectorViewObserver, false> observer_list_; |
55 | 58 |
56 DISALLOW_COPY_AND_ASSIGN(PermissionSelectorView); | 59 DISALLOW_COPY_AND_ASSIGN(PermissionSelectorView); |
57 }; | 60 }; |
58 | 61 |
59 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSION_SELECTOR_VIEW_H_ | 62 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSION_SELECTOR_VIEW_H_ |
OLD | NEW |