| 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 13 matching lines...) Expand all Loading... |
| 24 namespace views { | 24 namespace views { |
| 25 class ImageView; | 25 class ImageView; |
| 26 class MenuRunner; | 26 class MenuRunner; |
| 27 } | 27 } |
| 28 | 28 |
| 29 // A custom view for selecting a permission setting for the given permission | 29 // A custom view for selecting a permission setting for the given permission |
| 30 // |type|. | 30 // |type|. |
| 31 class PermissionSelectorView : public views::View, | 31 class PermissionSelectorView : public views::View, |
| 32 public PermissionMenuModel::Delegate { | 32 public PermissionMenuModel::Delegate { |
| 33 public: | 33 public: |
| 34 PermissionSelectorView(ContentSettingsType type, | 34 PermissionSelectorView(const GURL& url, |
| 35 ContentSettingsType type, |
| 35 ContentSetting default_setting, | 36 ContentSetting default_setting, |
| 36 ContentSetting current_setting, | 37 ContentSetting current_setting, |
| 37 content_settings::SettingSource source); | 38 content_settings::SettingSource source); |
| 38 | 39 |
| 39 void AddObserver(PermissionSelectorViewObserver* observer); | 40 void AddObserver(PermissionSelectorViewObserver* observer); |
| 40 | 41 |
| 41 // Returns the selected setting. | 42 // Returns the selected setting. |
| 42 ContentSetting current_setting() const { return current_setting_; } | 43 ContentSetting current_setting() const { return current_setting_; } |
| 43 | 44 |
| 44 // Returns the permission type. | 45 // Returns the permission type. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 68 | 69 |
| 69 // The currently active setting for the permission |type_|. | 70 // The currently active setting for the permission |type_|. |
| 70 ContentSetting current_setting_; | 71 ContentSetting current_setting_; |
| 71 | 72 |
| 72 ObserverList<PermissionSelectorViewObserver, false> observer_list_; | 73 ObserverList<PermissionSelectorViewObserver, false> observer_list_; |
| 73 | 74 |
| 74 DISALLOW_COPY_AND_ASSIGN(PermissionSelectorView); | 75 DISALLOW_COPY_AND_ASSIGN(PermissionSelectorView); |
| 75 }; | 76 }; |
| 76 | 77 |
| 77 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSION_SELECTOR_VIEW_H_ | 78 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSION_SELECTOR_VIEW_H_ |
| OLD | NEW |