| 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 #include "chrome/browser/ui/views/website_settings/permission_selector_view.h" | 5 #include "chrome/browser/ui/views/website_settings/permission_selector_view.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/ui/website_settings/website_settings_ui.h" | 8 #include "chrome/browser/ui/website_settings/website_settings_ui.h" |
| 9 #include "grit/generated_resources.h" | 9 #include "grit/generated_resources.h" |
| 10 #include "ui/base/accessibility/accessible_view_state.h" | 10 #include "ui/base/accessibility/accessible_view_state.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 const gfx::Point& point) { | 129 const gfx::Point& point) { |
| 130 menu_runner_.reset(new views::MenuRunner(menu_model_)); | 130 menu_runner_.reset(new views::MenuRunner(menu_model_)); |
| 131 | 131 |
| 132 gfx::Point p(point); | 132 gfx::Point p(point); |
| 133 p.Offset(-source->width(), 0); | 133 p.Offset(-source->width(), 0); |
| 134 if (menu_runner_->RunMenuAt( | 134 if (menu_runner_->RunMenuAt( |
| 135 source->GetWidget()->GetTopLevelWidget(), | 135 source->GetWidget()->GetTopLevelWidget(), |
| 136 this, | 136 this, |
| 137 gfx::Rect(p, gfx::Size()), | 137 gfx::Rect(p, gfx::Size()), |
| 138 views::MenuItemView::TOPLEFT, | 138 views::MenuItemView::TOPLEFT, |
| 139 ui::MENU_SOURCE_NONE, |
| 139 views::MenuRunner::HAS_MNEMONICS) == views::MenuRunner::MENU_DELETED) | 140 views::MenuRunner::HAS_MNEMONICS) == views::MenuRunner::MENU_DELETED) |
| 140 return; | 141 return; |
| 141 } | 142 } |
| 142 | 143 |
| 143 } // namespace internal | 144 } // namespace internal |
| 144 | 145 |
| 145 /////////////////////////////////////////////////////////////////////////////// | 146 /////////////////////////////////////////////////////////////////////////////// |
| 146 // PermissionSelectorView | 147 // PermissionSelectorView |
| 147 /////////////////////////////////////////////////////////////////////////////// | 148 /////////////////////////////////////////////////////////////////////////////// |
| 148 | 149 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 content_settings::SETTING_SOURCE_USER)); | 257 content_settings::SETTING_SOURCE_USER)); |
| 257 | 258 |
| 258 FOR_EACH_OBSERVER(PermissionSelectorViewObserver, | 259 FOR_EACH_OBSERVER(PermissionSelectorViewObserver, |
| 259 observer_list_, | 260 observer_list_, |
| 260 OnPermissionChanged(this)); | 261 OnPermissionChanged(this)); |
| 261 } | 262 } |
| 262 | 263 |
| 263 bool PermissionSelectorView::IsCommandIdChecked(int command_id) { | 264 bool PermissionSelectorView::IsCommandIdChecked(int command_id) { |
| 264 return current_setting_ == CommandIdToContentSetting(command_id); | 265 return current_setting_ == CommandIdToContentSetting(command_id); |
| 265 } | 266 } |
| OLD | NEW |