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

Side by Side Diff: chrome/browser/dom_ui/keyboard_ui.cc

Issue 5519016: Add a new GetInstance() method for singleton classes used in chrome/browser files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years 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 | « chrome/browser/dom_ui/history_ui.cc ('k') | chrome/browser/dom_ui/mediaplayer_ui.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/dom_ui/keyboard_ui.h" 5 #include "chrome/browser/dom_ui/keyboard_ui.h"
6 6
7 #include "app/resource_bundle.h" 7 #include "app/resource_bundle.h"
8 #include "base/ref_counted_memory.h" 8 #include "base/ref_counted_memory.h"
9 #include "base/singleton.h" 9 #include "base/singleton.h"
10 #include "base/string_piece.h" 10 #include "base/string_piece.h"
11 #include "chrome/browser/browser_thread.h" 11 #include "chrome/browser/browser_thread.h"
12 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" 12 #include "chrome/browser/dom_ui/chrome_url_data_manager.h"
13 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/common/url_constants.h" 14 #include "chrome/common/url_constants.h"
15 #include "grit/browser_resources.h" 15 #include "grit/browser_resources.h"
16 16
17 /////////////////////////////////////////////////////////////////////////////// 17 ///////////////////////////////////////////////////////////////////////////////
18 // KeyboardUI 18 // KeyboardUI
19 19
20 KeyboardUI::KeyboardUI(TabContents* contents) 20 KeyboardUI::KeyboardUI(TabContents* contents)
21 : DOMUI(contents) { 21 : DOMUI(contents) {
22 KeyboardHTMLSource* html_source = new KeyboardHTMLSource(); 22 KeyboardHTMLSource* html_source = new KeyboardHTMLSource();
23 BrowserThread::PostTask( 23 BrowserThread::PostTask(
24 BrowserThread::IO, FROM_HERE, 24 BrowserThread::IO, FROM_HERE,
25 NewRunnableMethod( 25 NewRunnableMethod(
26 Singleton<ChromeURLDataManager>::get(), 26 ChromeURLDataManager::GetInstance(),
27 &ChromeURLDataManager::AddDataSource, 27 &ChromeURLDataManager::AddDataSource,
28 make_scoped_refptr(html_source))); 28 make_scoped_refptr(html_source)));
29 } 29 }
30 30
31 KeyboardUI::~KeyboardUI() { 31 KeyboardUI::~KeyboardUI() {
32 } 32 }
33 33
34 /////////////////////////////////////////////////////////////////////////////// 34 ///////////////////////////////////////////////////////////////////////////////
35 // KeyboardHTMLSource 35 // KeyboardHTMLSource
36 36
37 KeyboardUI::KeyboardHTMLSource::KeyboardHTMLSource() 37 KeyboardUI::KeyboardHTMLSource::KeyboardHTMLSource()
38 : DataSource(chrome::kChromeUIKeyboardHost, MessageLoop::current()) { 38 : DataSource(chrome::kChromeUIKeyboardHost, MessageLoop::current()) {
39 } 39 }
40 40
41 void KeyboardUI::KeyboardHTMLSource::StartDataRequest(const std::string& path, 41 void KeyboardUI::KeyboardHTMLSource::StartDataRequest(const std::string& path,
42 bool is_off_the_record, 42 bool is_off_the_record,
43 int request_id) { 43 int request_id) {
44 NOTREACHED() << "We should never get here since the extension should have" 44 NOTREACHED() << "We should never get here since the extension should have"
45 << "been triggered"; 45 << "been triggered";
46 SendResponse(request_id, NULL); 46 SendResponse(request_id, NULL);
47 } 47 }
48 48
49 std::string KeyboardUI::KeyboardHTMLSource::GetMimeType( 49 std::string KeyboardUI::KeyboardHTMLSource::GetMimeType(
50 const std::string&) const { 50 const std::string&) const {
51 NOTREACHED() << "We should never get here since the extension should have" 51 NOTREACHED() << "We should never get here since the extension should have"
52 << "been triggered"; 52 << "been triggered";
53 return "text/html"; 53 return "text/html";
54 } 54 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/history_ui.cc ('k') | chrome/browser/dom_ui/mediaplayer_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698