| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser_actions_container.h" | 5 #include "chrome/browser/ui/views/browser_actions_container.h" |
| 6 | 6 |
| 7 #include "base/stl_util-inl.h" | 7 #include "base/stl_util-inl.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_window.h" | 10 #include "chrome/browser/browser_window.h" |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 gfx::Point point = gfx::Point(0, 0); | 219 gfx::Point point = gfx::Point(0, 0); |
| 220 ConvertPointToScreen(this, &point); | 220 ConvertPointToScreen(this, &point); |
| 221 | 221 |
| 222 // Make the menu appear below the button. | 222 // Make the menu appear below the button. |
| 223 point.Offset(0, height()); | 223 point.Offset(0, height()); |
| 224 | 224 |
| 225 ShowContextMenu(point, true); | 225 ShowContextMenu(point, true); |
| 226 return false; | 226 return false; |
| 227 } | 227 } |
| 228 | 228 |
| 229 void BrowserActionButton::OnMouseReleased(const views::MouseEvent& event, | 229 void BrowserActionButton::OnMouseReleased(const views::MouseEvent& event) { |
| 230 bool canceled) { | |
| 231 if (IsPopup() || showing_context_menu_) { | 230 if (IsPopup() || showing_context_menu_) { |
| 232 // TODO(erikkay) this never actually gets called (probably because of the | 231 // TODO(erikkay) this never actually gets called (probably because of the |
| 233 // loss of focus). | 232 // loss of focus). |
| 234 MenuButton::OnMouseReleased(event, canceled); | 233 MenuButton::OnMouseReleased(event); |
| 235 } else { | 234 } else { |
| 236 TextButton::OnMouseReleased(event, canceled); | 235 TextButton::OnMouseReleased(event); |
| 237 } | 236 } |
| 238 } | 237 } |
| 239 | 238 |
| 240 void BrowserActionButton::OnMouseExited(const views::MouseEvent& event) { | 239 void BrowserActionButton::OnMouseExited(const views::MouseEvent& event) { |
| 241 if (IsPopup() || showing_context_menu_) | 240 if (IsPopup() || showing_context_menu_) |
| 242 MenuButton::OnMouseExited(event); | 241 MenuButton::OnMouseExited(event); |
| 243 else | 242 else |
| 244 TextButton::OnMouseExited(event); | 243 TextButton::OnMouseExited(event); |
| 245 } | 244 } |
| 246 | 245 |
| (...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1093 AnimationEnded(resize_animation_.get()); | 1092 AnimationEnded(resize_animation_.get()); |
| 1094 } | 1093 } |
| 1095 } | 1094 } |
| 1096 | 1095 |
| 1097 bool BrowserActionsContainer::ShouldDisplayBrowserAction( | 1096 bool BrowserActionsContainer::ShouldDisplayBrowserAction( |
| 1098 const Extension* extension) { | 1097 const Extension* extension) { |
| 1099 // Only display incognito-enabled extensions while in incognito mode. | 1098 // Only display incognito-enabled extensions while in incognito mode. |
| 1100 return (!profile_->IsOffTheRecord() || | 1099 return (!profile_->IsOffTheRecord() || |
| 1101 profile_->GetExtensionService()->IsIncognitoEnabled(extension)); | 1100 profile_->GetExtensionService()->IsIncognitoEnabled(extension)); |
| 1102 } | 1101 } |
| OLD | NEW |