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

Side by Side Diff: chrome/browser/alternate_nav_url_fetcher.h

Issue 6249010: Cleanup: de-inline a bunch of classes, rename and move "PluginInstaller" to "... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/alternate_nav_url_fetcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_ALTERNATE_NAV_URL_FETCHER_H_ 5 #ifndef CHROME_BROWSER_ALTERNATE_NAV_URL_FETCHER_H_
6 #define CHROME_BROWSER_ALTERNATE_NAV_URL_FETCHER_H_ 6 #define CHROME_BROWSER_ALTERNATE_NAV_URL_FETCHER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 25 matching lines...) Expand all
36 IN_PROGRESS, 36 IN_PROGRESS,
37 SUCCEEDED, 37 SUCCEEDED,
38 FAILED, 38 FAILED,
39 }; 39 };
40 40
41 explicit AlternateNavURLFetcher(const GURL& alternate_nav_url); 41 explicit AlternateNavURLFetcher(const GURL& alternate_nav_url);
42 virtual ~AlternateNavURLFetcher(); 42 virtual ~AlternateNavURLFetcher();
43 43
44 State state() const { return state_; } 44 State state() const { return state_; }
45 45
46 private:
46 // NotificationObserver 47 // NotificationObserver
47 virtual void Observe(NotificationType type, 48 virtual void Observe(NotificationType type,
48 const NotificationSource& source, 49 const NotificationSource& source,
49 const NotificationDetails& details); 50 const NotificationDetails& details);
50 51
51 // URLFetcher::Delegate 52 // URLFetcher::Delegate
52 virtual void OnURLFetchComplete(const URLFetcher* source, 53 virtual void OnURLFetchComplete(const URLFetcher* source,
53 const GURL& url, 54 const GURL& url,
54 const net::URLRequestStatus& status, 55 const net::URLRequestStatus& status,
55 int response_code, 56 int response_code,
56 const ResponseCookies& cookies, 57 const ResponseCookies& cookies,
57 const std::string& data); 58 const std::string& data);
58 59
59 // LinkInfoBarDelegate 60 // LinkInfoBarDelegate
61 virtual SkBitmap* GetIcon() const;
60 virtual string16 GetMessageTextWithOffset(size_t* link_offset) const; 62 virtual string16 GetMessageTextWithOffset(size_t* link_offset) const;
61 virtual string16 GetLinkText() const; 63 virtual string16 GetLinkText() const;
62 virtual SkBitmap* GetIcon() const;
63 virtual bool LinkClicked(WindowOpenDisposition disposition); 64 virtual bool LinkClicked(WindowOpenDisposition disposition);
64 virtual void InfoBarClosed(); 65 virtual void InfoBarClosed();
65 66
66 private:
67 // Sets |state_| to either SUCCEEDED or FAILED depending on the result of the 67 // Sets |state_| to either SUCCEEDED or FAILED depending on the result of the
68 // fetch. 68 // fetch.
69 void SetStatusFromURLFetch(const GURL& url, 69 void SetStatusFromURLFetch(const GURL& url,
70 const net::URLRequestStatus& status, 70 const net::URLRequestStatus& status,
71 int response_code); 71 int response_code);
72 72
73 // Displays the infobar if all conditions are met (the page has loaded and 73 // Displays the infobar if all conditions are met (the page has loaded and
74 // the fetch of the alternate URL succeeded). 74 // the fetch of the alternate URL succeeded).
75 void ShowInfobarIfPossible(); 75 void ShowInfobarIfPossible();
76 76
77 GURL alternate_nav_url_; 77 GURL alternate_nav_url_;
78 scoped_ptr<URLFetcher> fetcher_; 78 scoped_ptr<URLFetcher> fetcher_;
79 NavigationController* controller_; 79 NavigationController* controller_;
80 State state_; 80 State state_;
81 bool navigated_to_entry_; 81 bool navigated_to_entry_;
82 82
83 // The TabContents the InfoBarDelegate was added to. 83 // The TabContents the InfoBarDelegate was added to.
84 TabContents* infobar_contents_; 84 TabContents* infobar_contents_;
85 85
86 NotificationRegistrar registrar_; 86 NotificationRegistrar registrar_;
87 87
88 DISALLOW_COPY_AND_ASSIGN(AlternateNavURLFetcher); 88 DISALLOW_COPY_AND_ASSIGN(AlternateNavURLFetcher);
89 }; 89 };
90 90
91 #endif // CHROME_BROWSER_ALTERNATE_NAV_URL_FETCHER_H_ 91 #endif // CHROME_BROWSER_ALTERNATE_NAV_URL_FETCHER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/alternate_nav_url_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698