| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/extensions/extension_installed_bubble_view.h" | 5 #include "chrome/browser/ui/views/extensions/extension_installed_bubble_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ptr_util.h" |
| 11 #include "base/metrics/user_metrics_action.h" | 12 #include "base/metrics/user_metrics_action.h" |
| 12 #include "chrome/browser/extensions/extension_action_manager.h" | 13 #include "chrome/browser/extensions/extension_action_manager.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
| 15 #include "chrome/browser/ui/browser_window.h" | 16 #include "chrome/browser/ui/browser_window.h" |
| 16 #include "chrome/browser/ui/chrome_pages.h" | 17 #include "chrome/browser/ui/chrome_pages.h" |
| 17 #include "chrome/browser/ui/singleton_tabs.h" | 18 #include "chrome/browser/ui/singleton_tabs.h" |
| 18 #include "chrome/browser/ui/views/frame/browser_view.h" | 19 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 19 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 20 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 20 #include "chrome/browser/ui/views/location_bar/page_action_with_badge_view.h" | 21 #include "chrome/browser/ui/views/location_bar/page_action_with_badge_view.h" |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 void Close() override; | 383 void Close() override; |
| 383 void UpdateAnchorPosition() override; | 384 void UpdateAnchorPosition() override; |
| 384 | 385 |
| 385 ExtensionInstalledBubble* bubble_; | 386 ExtensionInstalledBubble* bubble_; |
| 386 ExtensionInstalledBubbleView* delegate_view_; | 387 ExtensionInstalledBubbleView* delegate_view_; |
| 387 | 388 |
| 388 DISALLOW_COPY_AND_ASSIGN(ExtensionInstalledBubbleUi); | 389 DISALLOW_COPY_AND_ASSIGN(ExtensionInstalledBubbleUi); |
| 389 }; | 390 }; |
| 390 | 391 |
| 391 // Implemented here to create the platform specific instance of the BubbleUi. | 392 // Implemented here to create the platform specific instance of the BubbleUi. |
| 392 scoped_ptr<BubbleUi> ExtensionInstalledBubble::BuildBubbleUi() { | 393 std::unique_ptr<BubbleUi> ExtensionInstalledBubble::BuildBubbleUi() { |
| 393 return make_scoped_ptr(new ExtensionInstalledBubbleUi(this)); | 394 return base::WrapUnique(new ExtensionInstalledBubbleUi(this)); |
| 394 } | 395 } |
| 395 | 396 |
| 396 ExtensionInstalledBubbleUi::ExtensionInstalledBubbleUi( | 397 ExtensionInstalledBubbleUi::ExtensionInstalledBubbleUi( |
| 397 ExtensionInstalledBubble* bubble) | 398 ExtensionInstalledBubble* bubble) |
| 398 : bubble_(bubble), delegate_view_(nullptr) { | 399 : bubble_(bubble), delegate_view_(nullptr) { |
| 399 DCHECK(bubble_); | 400 DCHECK(bubble_); |
| 400 } | 401 } |
| 401 | 402 |
| 402 ExtensionInstalledBubbleUi::~ExtensionInstalledBubbleUi() {} | 403 ExtensionInstalledBubbleUi::~ExtensionInstalledBubbleUi() {} |
| 403 | 404 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 421 if (delegate_view_) { | 422 if (delegate_view_) { |
| 422 delegate_view_->GetWidget()->Close(); | 423 delegate_view_->GetWidget()->Close(); |
| 423 delegate_view_ = nullptr; | 424 delegate_view_ = nullptr; |
| 424 } | 425 } |
| 425 } | 426 } |
| 426 | 427 |
| 427 void ExtensionInstalledBubbleUi::UpdateAnchorPosition() { | 428 void ExtensionInstalledBubbleUi::UpdateAnchorPosition() { |
| 428 DCHECK(delegate_view_); | 429 DCHECK(delegate_view_); |
| 429 delegate_view_->UpdateAnchorView(); | 430 delegate_view_->UpdateAnchorView(); |
| 430 } | 431 } |
| OLD | NEW |