Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(336)

Side by Side Diff: chrome/browser/ui/views/extensions/extension_installed_bubble.cc

Issue 8068020: Converts usage of GetBrowserViewForNativeWindow to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporate review feedback, and make ShowPageInfo platform specific Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/extensions/extension_installed_bubble.h" 5 #include "chrome/browser/ui/views/extensions/extension_installed_bubble.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 const Extension* extension = 325 const Extension* extension =
326 Details<UnloadedExtensionInfo>(details)->extension; 326 Details<UnloadedExtensionInfo>(details)->extension;
327 if (extension == extension_) 327 if (extension == extension_)
328 extension_ = NULL; 328 extension_ = NULL;
329 } else { 329 } else {
330 NOTREACHED() << L"Received unexpected notification"; 330 NOTREACHED() << L"Received unexpected notification";
331 } 331 }
332 } 332 }
333 333
334 void ExtensionInstalledBubble::ShowInternal() { 334 void ExtensionInstalledBubble::ShowInternal() {
335 BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow( 335 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser_);
336 browser_->window()->GetNativeHandle());
337 336
338 const views::View* reference_view = NULL; 337 const views::View* reference_view = NULL;
339 if (type_ == APP) { 338 if (type_ == APP) {
340 if (browser_view->IsTabStripVisible()) { 339 if (browser_view->IsTabStripVisible()) {
341 AbstractTabStripView* tabstrip = browser_view->tabstrip(); 340 AbstractTabStripView* tabstrip = browser_view->tabstrip();
342 views::View* ntp_button = tabstrip->GetNewTabButton(); 341 views::View* ntp_button = tabstrip->GetNewTabButton();
343 if (ntp_button && ntp_button->IsVisibleInRootView()) { 342 if (ntp_button && ntp_button->IsVisibleInRootView()) {
344 reference_view = ntp_button; 343 reference_view = ntp_button;
345 } else { 344 } else {
346 // Just have the bubble point at the tab strip. 345 // Just have the bubble point at the tab strip.
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 browser_, extension_, type_, &icon_); 405 browser_, extension_, type_, &icon_);
407 Bubble* bubble = Bubble::Show(browser_view->GetWidget(), bounds, 406 Bubble* bubble = Bubble::Show(browser_view->GetWidget(), bounds,
408 arrow_location, bubble_content_, this); 407 arrow_location, bubble_content_, this);
409 bubble_content_->set_bubble(bubble); 408 bubble_content_->set_bubble(bubble);
410 } 409 }
411 410
412 // BubbleDelegate 411 // BubbleDelegate
413 void ExtensionInstalledBubble::BubbleClosing(Bubble* bubble, 412 void ExtensionInstalledBubble::BubbleClosing(Bubble* bubble,
414 bool closed_by_escape) { 413 bool closed_by_escape) {
415 if (extension_ && type_ == PAGE_ACTION) { 414 if (extension_ && type_ == PAGE_ACTION) {
416 BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow( 415 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser_);
417 browser_->window()->GetNativeHandle());
418 browser_view->GetLocationBarView()->SetPreviewEnabledPageAction( 416 browser_view->GetLocationBarView()->SetPreviewEnabledPageAction(
419 extension_->page_action(), 417 extension_->page_action(),
420 false); // preview_enabled 418 false); // preview_enabled
421 } 419 }
422 420
423 Release(); // Balanced in ctor. 421 Release(); // Balanced in ctor.
424 } 422 }
425 423
426 bool ExtensionInstalledBubble::CloseOnEscape() { 424 bool ExtensionInstalledBubble::CloseOnEscape() {
427 return true; 425 return true;
428 } 426 }
429 427
430 bool ExtensionInstalledBubble::FadeInOnShow() { 428 bool ExtensionInstalledBubble::FadeInOnShow() {
431 return true; 429 return true;
432 } 430 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698