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

Side by Side Diff: chrome/browser/tab_contents/infobar_delegate.cc

Issue 6883299: Hide translate infobar on programmatic navigation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Less invasive change 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/tab_contents/infobar_delegate.h" 5 #include "chrome/browser/tab_contents/infobar_delegate.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "content/browser/tab_contents/navigation_controller.h" 9 #include "content/browser/tab_contents/navigation_controller.h"
10 #include "content/browser/tab_contents/navigation_entry.h" 10 #include "content/browser/tab_contents/navigation_entry.h"
11 #include "content/browser/tab_contents/tab_contents.h" 11 #include "content/browser/tab_contents/tab_contents.h"
12 12
13 // InfoBarDelegate ------------------------------------------------------------ 13 // InfoBarDelegate ------------------------------------------------------------
14 14
15 InfoBarDelegate::~InfoBarDelegate() { 15 InfoBarDelegate::~InfoBarDelegate() {
16 } 16 }
17 17
18 bool InfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const { 18 bool InfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const {
19 return false; 19 return false;
20 } 20 }
21 21
22 bool InfoBarDelegate::ShouldExpire( 22 bool InfoBarDelegate::ShouldExpire(
23 const NavigationController::LoadCommittedDetails& details) const { 23 const NavigationController::LoadCommittedDetails& details) const {
24 return (contents_unique_id_ != details.entry->unique_id()) || 24 return (contents_unique_id_ != details.entry->unique_id()) ||
25 (PageTransition::StripQualifier(details.entry->transition_type()) == 25 (PageTransition::StripQualifier(details.entry->transition_type()) ==
26 PageTransition::RELOAD); 26 PageTransition::RELOAD);
27 } 27 }
28 28
29 bool InfoBarDelegate::DoNotCloseOnProgrammaticNavigation() const {
30 return true;
brettw 2011/05/13 17:04:45 Indentation messed up.
31 }
32
29 void InfoBarDelegate::InfoBarDismissed() { 33 void InfoBarDelegate::InfoBarDismissed() {
30 } 34 }
31 35
32 void InfoBarDelegate::InfoBarClosed() { 36 void InfoBarDelegate::InfoBarClosed() {
33 delete this; 37 delete this;
34 } 38 }
35 39
36 gfx::Image* InfoBarDelegate::GetIcon() const { 40 gfx::Image* InfoBarDelegate::GetIcon() const {
37 return NULL; 41 return NULL;
38 } 42 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 InfoBarDelegate::InfoBarDelegate(TabContents* contents) 74 InfoBarDelegate::InfoBarDelegate(TabContents* contents)
71 : contents_unique_id_(0) { 75 : contents_unique_id_(0) {
72 if (contents) 76 if (contents)
73 StoreActiveEntryUniqueID(contents); 77 StoreActiveEntryUniqueID(contents);
74 } 78 }
75 79
76 void InfoBarDelegate::StoreActiveEntryUniqueID(TabContents* contents) { 80 void InfoBarDelegate::StoreActiveEntryUniqueID(TabContents* contents) {
77 NavigationEntry* active_entry = contents->controller().GetActiveEntry(); 81 NavigationEntry* active_entry = contents->controller().GetActiveEntry();
78 contents_unique_id_ = active_entry ? active_entry->unique_id() : 0; 82 contents_unique_id_ = active_entry ? active_entry->unique_id() : 0;
79 } 83 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698