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" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 // Will be caught below. | 169 // Will be caught below. |
170 break; | 170 break; |
171 } | 171 } |
172 | 172 |
173 // Default case. | 173 // Default case. |
174 if (!reference_view) | 174 if (!reference_view) |
175 reference_view = browser_view->GetToolbarView()->app_menu_button(); | 175 reference_view = browser_view->GetToolbarView()->app_menu_button(); |
176 SetAnchorView(reference_view); | 176 SetAnchorView(reference_view); |
177 } | 177 } |
178 | 178 |
179 scoped_ptr<views::View> ExtensionInstalledBubbleView::CreateFootnoteView() { | 179 views::View* ExtensionInstalledBubbleView::CreateFootnoteView() { |
180 if (!(bubble_->options() & ExtensionInstalledBubble::SIGN_IN_PROMO)) | 180 if (!(bubble_->options() & ExtensionInstalledBubble::SIGN_IN_PROMO)) |
181 return nullptr; | 181 return nullptr; |
182 | 182 |
183 return scoped_ptr<views::View>( | 183 return new BubbleSyncPromoView(this, |
184 new BubbleSyncPromoView(this, IDS_EXTENSION_INSTALLED_SYNC_PROMO_LINK_NEW, | 184 IDS_EXTENSION_INSTALLED_SYNC_PROMO_LINK_NEW, |
185 IDS_EXTENSION_INSTALLED_SYNC_PROMO_NEW)); | 185 IDS_EXTENSION_INSTALLED_SYNC_PROMO_NEW); |
186 } | 186 } |
187 | 187 |
188 void ExtensionInstalledBubbleView::WindowClosing() { | 188 void ExtensionInstalledBubbleView::WindowClosing() { |
189 if (anchor_position_ == ExtensionInstalledBubble::ANCHOR_PAGE_ACTION) { | 189 if (anchor_position_ == ExtensionInstalledBubble::ANCHOR_PAGE_ACTION) { |
190 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser_); | 190 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser_); |
191 browser_view->GetLocationBarView()->SetPreviewEnabledPageAction( | 191 browser_view->GetLocationBarView()->SetPreviewEnabledPageAction( |
192 extensions::ExtensionActionManager::Get(browser_->profile()) | 192 extensions::ExtensionActionManager::Get(browser_->profile()) |
193 ->GetPageAction(*extension_), | 193 ->GetPageAction(*extension_), |
194 false); // preview_enabled | 194 false); // preview_enabled |
195 } | 195 } |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 if (delegate_view_) { | 421 if (delegate_view_) { |
422 delegate_view_->GetWidget()->Close(); | 422 delegate_view_->GetWidget()->Close(); |
423 delegate_view_ = nullptr; | 423 delegate_view_ = nullptr; |
424 } | 424 } |
425 } | 425 } |
426 | 426 |
427 void ExtensionInstalledBubbleUi::UpdateAnchorPosition() { | 427 void ExtensionInstalledBubbleUi::UpdateAnchorPosition() { |
428 DCHECK(delegate_view_); | 428 DCHECK(delegate_view_); |
429 delegate_view_->UpdateAnchorView(); | 429 delegate_view_->UpdateAnchorView(); |
430 } | 430 } |
OLD | NEW |