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

Side by Side Diff: chrome/browser/translate/translate_infobar_delegate.cc

Issue 6926001: Replace the virtual InfoBarDelegate::InfoBarClosed() function with a non-virtual one. This is a ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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 | 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/translate/translate_infobar_delegate.h" 5 #include "chrome/browser/translate/translate_infobar_delegate.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 352
353 void TranslateInfoBarDelegate::InfoBarDismissed() { 353 void TranslateInfoBarDelegate::InfoBarDismissed() {
354 if (type_ != BEFORE_TRANSLATE) 354 if (type_ != BEFORE_TRANSLATE)
355 return; 355 return;
356 356
357 // The user closed the infobar without clicking the translate button. 357 // The user closed the infobar without clicking the translate button.
358 TranslationDeclined(); 358 TranslationDeclined();
359 UMA_HISTOGRAM_COUNTS("Translate.DeclineTranslateCloseInfobar", 1); 359 UMA_HISTOGRAM_COUNTS("Translate.DeclineTranslateCloseInfobar", 1);
360 } 360 }
361 361
362 void TranslateInfoBarDelegate::InfoBarClosed() {
363 delete this;
364 }
365
366 gfx::Image* TranslateInfoBarDelegate::GetIcon() const { 362 gfx::Image* TranslateInfoBarDelegate::GetIcon() const {
367 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( 363 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed(
368 IDR_INFOBAR_TRANSLATE); 364 IDR_INFOBAR_TRANSLATE);
369 } 365 }
370 366
371 InfoBarDelegate::Type TranslateInfoBarDelegate::GetInfoBarType() const { 367 InfoBarDelegate::Type TranslateInfoBarDelegate::GetInfoBarType() const {
372 return PAGE_ACTION_TYPE; 368 return PAGE_ACTION_TYPE;
373 } 369 }
374 370
375 TranslateInfoBarDelegate* 371 TranslateInfoBarDelegate*
376 TranslateInfoBarDelegate::AsTranslateInfoBarDelegate() { 372 TranslateInfoBarDelegate::AsTranslateInfoBarDelegate() {
377 return this; 373 return this;
378 } 374 }
379 375
380 std::string TranslateInfoBarDelegate::GetPageHost() { 376 std::string TranslateInfoBarDelegate::GetPageHost() {
381 NavigationEntry* entry = tab_contents_->controller().GetActiveEntry(); 377 NavigationEntry* entry = tab_contents_->controller().GetActiveEntry();
382 return entry ? entry->url().HostNoBrackets() : std::string(); 378 return entry ? entry->url().HostNoBrackets() : std::string();
383 } 379 }
OLDNEW
« no previous file with comments | « chrome/browser/translate/translate_infobar_delegate.h ('k') | chrome/browser/ui/browser_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698