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

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

Issue 10883008: Port the Extension Install Bubble changes to Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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) 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/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 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 new ExtensionInstalledBubble(extension, browser, icon); 344 new ExtensionInstalledBubble(extension, browser, icon);
345 } 345 }
346 346
347 ExtensionInstalledBubble::ExtensionInstalledBubble(const Extension* extension, 347 ExtensionInstalledBubble::ExtensionInstalledBubble(const Extension* extension,
348 Browser *browser, 348 Browser *browser,
349 const SkBitmap& icon) 349 const SkBitmap& icon)
350 : extension_(extension), 350 : extension_(extension),
351 browser_(browser), 351 browser_(browser),
352 icon_(icon), 352 icon_(icon),
353 animation_wait_retries_(0) { 353 animation_wait_retries_(0) {
354 if (extension->is_app()) { 354 if (extension->is_app())
355 type_ = APP; 355 type_ = APP;
356 } else if (!extension_->omnibox_keyword().empty()) { 356 else if (!extension_->omnibox_keyword().empty())
357 type_ = OMNIBOX_KEYWORD; 357 type_ = OMNIBOX_KEYWORD;
358 } else if (extension_->browser_action()) { 358 else if (extension_->browser_action())
359 type_ = BROWSER_ACTION; 359 type_ = BROWSER_ACTION;
360 } else if (extension->page_action() && 360 else if (extension->page_action() && extension->is_verbose_install_message())
361 !extension->page_action()->default_icon_path().empty()) {
362 type_ = PAGE_ACTION; 361 type_ = PAGE_ACTION;
363 } else { 362 else
364 type_ = GENERIC; 363 type_ = GENERIC;
365 }
366 364
367 // |extension| has been initialized but not loaded at this point. We need 365 // |extension| has been initialized but not loaded at this point. We need
368 // to wait on showing the Bubble until not only the EXTENSION_LOADED gets 366 // to wait on showing the Bubble until not only the EXTENSION_LOADED gets
369 // fired, but all of the EXTENSION_LOADED Observers have run. Only then can we 367 // fired, but all of the EXTENSION_LOADED Observers have run. Only then can we
370 // be sure that a BrowserAction or PageAction has had views created which we 368 // be sure that a BrowserAction or PageAction has had views created which we
371 // can inspect for the purpose of previewing of pointing to them. 369 // can inspect for the purpose of previewing of pointing to them.
372 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, 370 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
373 content::Source<Profile>(browser->profile())); 371 content::Source<Profile>(browser->profile()));
374 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, 372 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
375 content::Source<Profile>(browser->profile())); 373 content::Source<Profile>(browser->profile()));
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 } 479 }
482 480
483 void ExtensionInstalledBubble::WindowClosing() { 481 void ExtensionInstalledBubble::WindowClosing() {
484 if (extension_ && type_ == PAGE_ACTION) { 482 if (extension_ && type_ == PAGE_ACTION) {
485 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser_); 483 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser_);
486 browser_view->GetLocationBarView()->SetPreviewEnabledPageAction( 484 browser_view->GetLocationBarView()->SetPreviewEnabledPageAction(
487 extension_->page_action(), 485 extension_->page_action(),
488 false); // preview_enabled 486 false); // preview_enabled
489 } 487 }
490 } 488 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/extensions/extension_installed_bubble_gtk.cc ('k') | chrome/common/extensions/extension.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698