OLD | NEW |
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 #ifndef CHROME_BROWSER_UI_WEBUI_CHROME_WEB_UI_CONTROLLER_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROME_WEB_UI_CONTROLLER_FACTORY_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_CHROME_WEB_UI_CONTROLLER_FACTORY_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROME_WEB_UI_CONTROLLER_FACTORY_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "content/public/browser/web_ui.h" | 10 #include "content/public/browser/web_ui.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 // Get the favicon for |page_url| and run |callback| with result when loaded. | 36 // Get the favicon for |page_url| and run |callback| with result when loaded. |
37 // Note. |callback| is always run asynchronously. | 37 // Note. |callback| is always run asynchronously. |
38 void GetFaviconForURL( | 38 void GetFaviconForURL( |
39 Profile* profile, | 39 Profile* profile, |
40 const GURL& page_url, | 40 const GURL& page_url, |
41 const std::vector<ui::ScaleFactor>& scale_factors, | 41 const std::vector<ui::ScaleFactor>& scale_factors, |
42 const FaviconService::FaviconResultsCallback& callback) const; | 42 const FaviconService::FaviconResultsCallback& callback) const; |
43 | 43 |
44 static ChromeWebUIControllerFactory* GetInstance(); | 44 static ChromeWebUIControllerFactory* GetInstance(); |
45 | 45 |
46 static void UseTestFactoryForTesting(); | |
47 | |
48 protected: | 46 protected: |
49 ChromeWebUIControllerFactory(); | 47 ChromeWebUIControllerFactory(); |
50 virtual ~ChromeWebUIControllerFactory(); | 48 virtual ~ChromeWebUIControllerFactory(); |
51 | 49 |
52 private: | 50 private: |
53 | |
54 friend struct DefaultSingletonTraits<ChromeWebUIControllerFactory>; | 51 friend struct DefaultSingletonTraits<ChromeWebUIControllerFactory>; |
55 | 52 |
56 // Gets the data for the favicon for a WebUI page. Returns NULL if the WebUI | 53 // Gets the data for the favicon for a WebUI page. Returns NULL if the WebUI |
57 // does not have a favicon. | 54 // does not have a favicon. |
58 // The returned favicon data must be | 55 // The returned favicon data must be |
59 // |gfx::kFaviconSize| x |gfx::kFaviconSize| DIP. GetFaviconForURL() should | 56 // |gfx::kFaviconSize| x |gfx::kFaviconSize| DIP. GetFaviconForURL() should |
60 // be updated if this changes. | 57 // be updated if this changes. |
61 base::RefCountedMemory* GetFaviconResourceBytes( | 58 base::RefCountedMemory* GetFaviconResourceBytes( |
62 const GURL& page_url, ui::ScaleFactor scale_factor) const; | 59 const GURL& page_url, ui::ScaleFactor scale_factor) const; |
63 | 60 |
64 DISALLOW_COPY_AND_ASSIGN(ChromeWebUIControllerFactory); | 61 DISALLOW_COPY_AND_ASSIGN(ChromeWebUIControllerFactory); |
65 }; | 62 }; |
66 | 63 |
67 #endif // CHROME_BROWSER_UI_WEBUI_CHROME_WEB_UI_CONTROLLER_FACTORY_H_ | 64 #endif // CHROME_BROWSER_UI_WEBUI_CHROME_WEB_UI_CONTROLLER_FACTORY_H_ |
OLD | NEW |