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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 gfx::Point origin(screen_bounds.origin()); | 82 gfx::Point origin(screen_bounds.origin()); |
83 View::ConvertPointToScreen(this, &origin); | 83 View::ConvertPointToScreen(this, &origin); |
84 screen_bounds.set_origin(origin); | 84 screen_bounds.set_origin(origin); |
85 | 85 |
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(), | |
93 browser->window()->GetNativeHandle(), | |
94 screen_bounds, | 92 screen_bounds, |
95 arrow_location, | 93 arrow_location, |
96 true, // Activate the popup window. | |
97 inspect_with_devtools, | 94 inspect_with_devtools, |
98 ExtensionPopup::BUBBLE_CHROME, | |
99 this); // ExtensionPopup::Observer | 95 this); // ExtensionPopup::Observer |
100 } else { | 96 } else { |
101 ExtensionService* service = profile_->GetExtensionService(); | 97 ExtensionService* service = profile_->GetExtensionService(); |
102 service->browser_event_router()->PageActionExecuted( | 98 service->browser_event_router()->PageActionExecuted( |
103 profile_, page_action_->extension_id(), page_action_->id(), | 99 profile_, page_action_->extension_id(), page_action_->id(), |
104 current_tab_id_, current_url_.spec(), button); | 100 current_tab_id_, current_url_.spec(), button); |
105 } | 101 } |
106 } | 102 } |
107 | 103 |
108 AccessibilityTypes::Role PageActionImageView::GetAccessibleRole() { | 104 AccessibilityTypes::Role PageActionImageView::GetAccessibleRole() { |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 void PageActionImageView::ExtensionPopupIsClosing(ExtensionPopup* popup) { | 237 void PageActionImageView::ExtensionPopupIsClosing(ExtensionPopup* popup) { |
242 DCHECK_EQ(popup_, popup); | 238 DCHECK_EQ(popup_, popup); |
243 // ExtensionPopup is ref-counted, so we don't need to delete it. | 239 // ExtensionPopup is ref-counted, so we don't need to delete it. |
244 popup_ = NULL; | 240 popup_ = NULL; |
245 } | 241 } |
246 | 242 |
247 void PageActionImageView::HidePopup() { | 243 void PageActionImageView::HidePopup() { |
248 if (popup_) | 244 if (popup_) |
249 popup_->Close(); | 245 popup_->Close(); |
250 } | 246 } |
OLD | NEW |