| 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/location_bar/page_action_image_view.h" | 5 #include "chrome/browser/ui/views/location_bar/page_action_image_view.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/browser_list.h" | 8 #include "chrome/browser/browser_list.h" |
| 9 #include "chrome/browser/extensions/extension_browser_event_router.h" | 9 #include "chrome/browser/extensions/extension_browser_event_router.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 BubbleBorder::ArrowLocation arrow_location = base::i18n::IsRTL() ? | 86 BubbleBorder::ArrowLocation arrow_location = base::i18n::IsRTL() ? |
| 87 BubbleBorder::TOP_LEFT : BubbleBorder::TOP_RIGHT; | 87 BubbleBorder::TOP_LEFT : BubbleBorder::TOP_RIGHT; |
| 88 | 88 |
| 89 popup_ = ExtensionPopup::Show( | 89 popup_ = ExtensionPopup::Show( |
| 90 page_action_->GetPopupUrl(current_tab_id_), | 90 page_action_->GetPopupUrl(current_tab_id_), |
| 91 browser, | 91 browser, |
| 92 browser->profile(), | 92 browser->profile(), |
| 93 browser->window()->GetNativeHandle(), | 93 browser->window()->GetNativeHandle(), |
| 94 screen_bounds, | 94 screen_bounds, |
| 95 arrow_location, | 95 arrow_location, |
| 96 true, // Activate the popup window. | |
| 97 inspect_with_devtools, | 96 inspect_with_devtools, |
| 98 ExtensionPopup::BUBBLE_CHROME, | |
| 99 this); // ExtensionPopup::Observer | 97 this); // ExtensionPopup::Observer |
| 100 } else { | 98 } else { |
| 101 ExtensionService* service = profile_->GetExtensionService(); | 99 ExtensionService* service = profile_->GetExtensionService(); |
| 102 service->browser_event_router()->PageActionExecuted( | 100 service->browser_event_router()->PageActionExecuted( |
| 103 profile_, page_action_->extension_id(), page_action_->id(), | 101 profile_, page_action_->extension_id(), page_action_->id(), |
| 104 current_tab_id_, current_url_.spec(), button); | 102 current_tab_id_, current_url_.spec(), button); |
| 105 } | 103 } |
| 106 } | 104 } |
| 107 | 105 |
| 108 AccessibilityTypes::Role PageActionImageView::GetAccessibleRole() { | 106 AccessibilityTypes::Role PageActionImageView::GetAccessibleRole() { |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 void PageActionImageView::ExtensionPopupIsClosing(ExtensionPopup* popup) { | 239 void PageActionImageView::ExtensionPopupIsClosing(ExtensionPopup* popup) { |
| 242 DCHECK_EQ(popup_, popup); | 240 DCHECK_EQ(popup_, popup); |
| 243 // ExtensionPopup is ref-counted, so we don't need to delete it. | 241 // ExtensionPopup is ref-counted, so we don't need to delete it. |
| 244 popup_ = NULL; | 242 popup_ = NULL; |
| 245 } | 243 } |
| 246 | 244 |
| 247 void PageActionImageView::HidePopup() { | 245 void PageActionImageView::HidePopup() { |
| 248 if (popup_) | 246 if (popup_) |
| 249 popup_->Close(); | 247 popup_->Close(); |
| 250 } | 248 } |
| OLD | NEW |