| 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/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/extensions/api/commands/command_service.h" | 8 #include "chrome/browser/extensions/api/commands/command_service.h" |
| 9 #include "chrome/browser/extensions/api/commands/command_service_factory.h" | 9 #include "chrome/browser/extensions/api/commands/command_service_factory.h" |
| 10 #include "chrome/browser/extensions/extension_context_menu_model.h" | 10 #include "chrome/browser/extensions/extension_context_menu_model.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 Browser* browser) | 42 Browser* browser) |
| 43 : owner_(owner), | 43 : owner_(owner), |
| 44 page_action_(page_action), | 44 page_action_(page_action), |
| 45 browser_(browser), | 45 browser_(browser), |
| 46 ALLOW_THIS_IN_INITIALIZER_LIST(tracker_(this)), | 46 ALLOW_THIS_IN_INITIALIZER_LIST(tracker_(this)), |
| 47 current_tab_id_(-1), | 47 current_tab_id_(-1), |
| 48 preview_enabled_(false), | 48 preview_enabled_(false), |
| 49 popup_(NULL), | 49 popup_(NULL), |
| 50 ALLOW_THIS_IN_INITIALIZER_LIST(scoped_icon_animation_observer_( | 50 ALLOW_THIS_IN_INITIALIZER_LIST(scoped_icon_animation_observer_( |
| 51 page_action->GetIconAnimation( | 51 page_action->GetIconAnimation( |
| 52 SessionID::IdForTab(owner->GetTabContents())), | 52 SessionID::IdForTab(owner->GetTabContents()->web_contents())), |
| 53 this)) { | 53 this)) { |
| 54 const Extension* extension = owner_->profile()->GetExtensionService()-> | 54 const Extension* extension = owner_->profile()->GetExtensionService()-> |
| 55 GetExtensionById(page_action->extension_id(), false); | 55 GetExtensionById(page_action->extension_id(), false); |
| 56 DCHECK(extension); | 56 DCHECK(extension); |
| 57 | 57 |
| 58 // Load all the icons declared in the manifest. This is the contents of the | 58 // Load all the icons declared in the manifest. This is the contents of the |
| 59 // icons array, plus the default_icon property, if any. | 59 // icons array, plus the default_icon property, if any. |
| 60 std::vector<std::string> icon_paths(*page_action->icon_paths()); | 60 std::vector<std::string> icon_paths(*page_action->icon_paths()); |
| 61 if (!page_action_->default_icon_path().empty()) | 61 if (!page_action_->default_icon_path().empty()) |
| 62 icon_paths.push_back(page_action_->default_icon_path()); | 62 icon_paths.push_back(page_action_->default_icon_path()); |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 views::BubbleBorder::TOP_LEFT : views::BubbleBorder::TOP_RIGHT; | 316 views::BubbleBorder::TOP_LEFT : views::BubbleBorder::TOP_RIGHT; |
| 317 | 317 |
| 318 popup_ = ExtensionPopup::ShowPopup(popup_url, browser_, this, arrow_location); | 318 popup_ = ExtensionPopup::ShowPopup(popup_url, browser_, this, arrow_location); |
| 319 popup_->GetWidget()->AddObserver(this); | 319 popup_->GetWidget()->AddObserver(this); |
| 320 } | 320 } |
| 321 | 321 |
| 322 void PageActionImageView::HidePopup() { | 322 void PageActionImageView::HidePopup() { |
| 323 if (popup_) | 323 if (popup_) |
| 324 popup_->GetWidget()->Close(); | 324 popup_->GetWidget()->Close(); |
| 325 } | 325 } |
| OLD | NEW |