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

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

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 #ifndef CHROME_BROWSER_TAB_CONTENTS_INFOBAR_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_INFOBAR_DELEGATE_H_
6 #define CHROME_BROWSER_TAB_CONTENTS_INFOBAR_DELEGATE_H_ 6 #define CHROME_BROWSER_TAB_CONTENTS_INFOBAR_DELEGATE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/string16.h" 10 #include "base/string16.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // TabContents will not add the new delegate because it considers one to 50 // TabContents will not add the new delegate because it considers one to
51 // already be present. 51 // already be present.
52 virtual bool EqualsDelegate(InfoBarDelegate* delegate) const; 52 virtual bool EqualsDelegate(InfoBarDelegate* delegate) const;
53 53
54 // Returns true if the InfoBar should be closed automatically after the page 54 // Returns true if the InfoBar should be closed automatically after the page
55 // is navigated. The default behavior is to return true if the page is 55 // is navigated. The default behavior is to return true if the page is
56 // navigated somewhere else or reloaded. 56 // navigated somewhere else or reloaded.
57 virtual bool ShouldExpire( 57 virtual bool ShouldExpire(
58 const NavigationController::LoadCommittedDetails& details) const; 58 const NavigationController::LoadCommittedDetails& details) const;
59 59
60 // Returning true indicates that this InfoBar should not be closed if the
61 // navigation is programmatic and not user-intiated.
62 virtual bool DoNotCloseOnProgrammaticNavigation() const;
63
60 // Called when the user clicks on the close button to dismiss the infobar. 64 // Called when the user clicks on the close button to dismiss the infobar.
61 virtual void InfoBarDismissed(); 65 virtual void InfoBarDismissed();
62 66
63 // Called after the InfoBar is closed. Deletes |this|. 67 // Called after the InfoBar is closed. Deletes |this|.
64 // TODO(pkasting): Get rid of this and delete delegates directly. 68 // TODO(pkasting): Get rid of this and delete delegates directly.
65 void InfoBarClosed(); 69 void InfoBarClosed();
66 70
67 // Return the icon to be shown for this InfoBar. If the returned Image is 71 // Return the icon to be shown for this InfoBar. If the returned Image is
68 // NULL, no icon is shown. 72 // NULL, no icon is shown.
69 virtual gfx::Image* GetIcon() const; 73 virtual gfx::Image* GetIcon() const;
(...skipping 14 matching lines...) Expand all
84 // Provided to subclasses as a convenience to initialize the state of this 88 // Provided to subclasses as a convenience to initialize the state of this
85 // object. If |contents| is non-NULL, its active entry's unique ID will be 89 // object. If |contents| is non-NULL, its active entry's unique ID will be
86 // stored using StoreActiveEntryUniqueID automatically. 90 // stored using StoreActiveEntryUniqueID automatically.
87 explicit InfoBarDelegate(TabContents* contents); 91 explicit InfoBarDelegate(TabContents* contents);
88 92
89 // Store the unique id for the active entry in the specified TabContents, to 93 // Store the unique id for the active entry in the specified TabContents, to
90 // be used later upon navigation to determine if this InfoBarDelegate should 94 // be used later upon navigation to determine if this InfoBarDelegate should
91 // be expired from |contents_|. 95 // be expired from |contents_|.
92 void StoreActiveEntryUniqueID(TabContents* contents); 96 void StoreActiveEntryUniqueID(TabContents* contents);
93 97
94 private:
95 // The unique id of the active NavigationEntry of the TabContents that we were 98 // The unique id of the active NavigationEntry of the TabContents that we were
96 // opened for. Used to help expire on navigations. 99 // opened for. Used to help expire on navigations.
97 int contents_unique_id_; 100 int contents_unique_id_;
98 101
102 private:
99 DISALLOW_COPY_AND_ASSIGN(InfoBarDelegate); 103 DISALLOW_COPY_AND_ASSIGN(InfoBarDelegate);
100 }; 104 };
101 105
102 #endif // CHROME_BROWSER_TAB_CONTENTS_INFOBAR_DELEGATE_H_ 106 #endif // CHROME_BROWSER_TAB_CONTENTS_INFOBAR_DELEGATE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/tab_contents/infobar_delegate.cc » ('j') | chrome/browser/tab_contents/infobar_delegate.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698