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

Side by Side Diff: chrome/browser/plugins/plugin_infobar_delegates.cc

Issue 15067008: [InfoBar] Add InfoBarDelegate::GetIconID() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renaming back to GetIcon() Created 7 years, 7 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
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/plugins/plugin_infobar_delegates.h" 5 #include "chrome/browser/plugins/plugin_infobar_delegates.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/content_settings/host_content_settings_map.h" 8 #include "chrome/browser/content_settings/host_content_settings_map.h"
9 #include "chrome/browser/google/google_util.h" 9 #include "chrome/browser/google/google_util.h"
10 #include "chrome/browser/infobars/infobar_service.h" 10 #include "chrome/browser/infobars/infobar_service.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 void PluginInfoBarDelegate::LoadBlockedPlugins() { 67 void PluginInfoBarDelegate::LoadBlockedPlugins() {
68 if (web_contents()) { 68 if (web_contents()) {
69 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); 69 content::RenderViewHost* host = web_contents()->GetRenderViewHost();
70 ChromePluginServiceFilter::GetInstance()->AuthorizeAllPlugins( 70 ChromePluginServiceFilter::GetInstance()->AuthorizeAllPlugins(
71 host->GetProcess()->GetID()); 71 host->GetProcess()->GetID());
72 host->Send(new ChromeViewMsg_LoadBlockedPlugins( 72 host->Send(new ChromeViewMsg_LoadBlockedPlugins(
73 host->GetRoutingID(), identifier_)); 73 host->GetRoutingID(), identifier_));
74 } 74 }
75 } 75 }
76 76
77 gfx::Image* PluginInfoBarDelegate::GetIcon() const { 77 int PluginInfoBarDelegate::GetIconID() const {
78 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( 78 return IDR_INFOBAR_PLUGIN_INSTALL;
79 IDR_INFOBAR_PLUGIN_INSTALL);
80 } 79 }
81 80
82 string16 PluginInfoBarDelegate::GetLinkText() const { 81 string16 PluginInfoBarDelegate::GetLinkText() const {
83 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); 82 return l10n_util::GetStringUTF16(IDS_LEARN_MORE);
84 } 83 }
85 84
86 85
87 // UnauthorizedPluginInfoBarDelegate ------------------------------------------ 86 // UnauthorizedPluginInfoBarDelegate ------------------------------------------
88 87
89 // static 88 // static
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 WeakPluginInstallerObserver(installer), 383 WeakPluginInstallerObserver(installer),
385 plugin_metadata_(plugin_metadata.Pass()), 384 plugin_metadata_(plugin_metadata.Pass()),
386 callback_(callback), 385 callback_(callback),
387 new_install_(new_install), 386 new_install_(new_install),
388 message_(message) { 387 message_(message) {
389 } 388 }
390 389
391 PluginInstallerInfoBarDelegate::~PluginInstallerInfoBarDelegate() { 390 PluginInstallerInfoBarDelegate::~PluginInstallerInfoBarDelegate() {
392 } 391 }
393 392
394 gfx::Image* PluginInstallerInfoBarDelegate::GetIcon() const { 393 int PluginInstallerInfoBarDelegate::GetIconID() const {
395 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( 394 return IDR_INFOBAR_PLUGIN_INSTALL;
396 IDR_INFOBAR_PLUGIN_INSTALL);
397 } 395 }
398 396
399 string16 PluginInstallerInfoBarDelegate::GetMessageText() const { 397 string16 PluginInstallerInfoBarDelegate::GetMessageText() const {
400 return message_; 398 return message_;
401 } 399 }
402 400
403 int PluginInstallerInfoBarDelegate::GetButtons() const { 401 int PluginInstallerInfoBarDelegate::GetButtons() const {
404 return callback_.is_null() ? BUTTON_NONE : BUTTON_OK; 402 return callback_.is_null() ? BUTTON_NONE : BUTTON_OK;
405 } 403 }
406 404
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 PluginMetroModeInfoBarDelegate::Mode mode, 493 PluginMetroModeInfoBarDelegate::Mode mode,
496 const string16& name) 494 const string16& name)
497 : ConfirmInfoBarDelegate(infobar_service), 495 : ConfirmInfoBarDelegate(infobar_service),
498 mode_(mode), 496 mode_(mode),
499 name_(name) { 497 name_(name) {
500 } 498 }
501 499
502 PluginMetroModeInfoBarDelegate::~PluginMetroModeInfoBarDelegate() { 500 PluginMetroModeInfoBarDelegate::~PluginMetroModeInfoBarDelegate() {
503 } 501 }
504 502
505 gfx::Image* PluginMetroModeInfoBarDelegate::GetIcon() const { 503 int PluginMetroModeInfoBarDelegate::GetIconID() const {
506 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( 504 return IDR_INFOBAR_PLUGIN_INSTALL;
507 IDR_INFOBAR_PLUGIN_INSTALL);
508 } 505 }
509 506
510 string16 PluginMetroModeInfoBarDelegate::GetMessageText() const { 507 string16 PluginMetroModeInfoBarDelegate::GetMessageText() const {
511 return l10n_util::GetStringFUTF16((mode_ == MISSING_PLUGIN) ? 508 return l10n_util::GetStringFUTF16((mode_ == MISSING_PLUGIN) ?
512 IDS_METRO_MISSING_PLUGIN_PROMPT : IDS_METRO_NPAPI_PLUGIN_PROMPT, name_); 509 IDS_METRO_MISSING_PLUGIN_PROMPT : IDS_METRO_NPAPI_PLUGIN_PROMPT, name_);
513 } 510 }
514 511
515 int PluginMetroModeInfoBarDelegate::GetButtons() const { 512 int PluginMetroModeInfoBarDelegate::GetButtons() const {
516 return (mode_ == MISSING_PLUGIN) ? BUTTON_OK : (BUTTON_OK | BUTTON_CANCEL); 513 return (mode_ == MISSING_PLUGIN) ? BUTTON_OK : (BUTTON_OK | BUTTON_CANCEL);
517 } 514 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 Referrer(), 555 Referrer(),
559 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, 556 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
560 content::PAGE_TRANSITION_LINK, false); 557 content::PAGE_TRANSITION_LINK, false);
561 web_contents()->OpenURL(params); 558 web_contents()->OpenURL(params);
562 return false; 559 return false;
563 } 560 }
564 561
565 #endif // defined(OS_WIN) 562 #endif // defined(OS_WIN)
566 563
567 #endif // defined(ENABLE_PLUGIN_INSTALLATION) 564 #endif // defined(ENABLE_PLUGIN_INSTALLATION)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698