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

Side by Side Diff: chrome/browser/ui/webui/aura/app_list_ui.cc

Issue 8986007: Move WebUIMessageHandler to its own file in the public directory and put it in the content namesp... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 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
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/ui/webui/aura/app_list_ui.h" 5 #include "chrome/browser/ui/webui/aura/app_list_ui.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/google/google_util.h" 8 #include "chrome/browser/google/google_util.h"
9 #include "chrome/browser/prefs/pref_service.h" 9 #include "chrome/browser/prefs/pref_service.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" 11 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h"
12 #include "chrome/browser/ui/webui/aura/app_list_ui_delegate.h" 12 #include "chrome/browser/ui/webui/aura/app_list_ui_delegate.h"
13 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" 13 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h"
14 #include "chrome/common/extensions/extension_constants.h" 14 #include "chrome/common/extensions/extension_constants.h"
15 #include "chrome/common/pref_names.h" 15 #include "chrome/common/pref_names.h"
16 #include "chrome/common/url_constants.h" 16 #include "chrome/common/url_constants.h"
17 #include "content/public/browser/web_contents.h" 17 #include "content/public/browser/web_contents.h"
18 #include "content/public/browser/web_ui_message_handler.h"
18 #include "grit/browser_resources.h" 19 #include "grit/browser_resources.h"
19 #include "grit/chromium_strings.h" 20 #include "grit/chromium_strings.h"
20 #include "grit/generated_resources.h" 21 #include "grit/generated_resources.h"
21 #include "ui/base/l10n/l10n_util.h" 22 #include "ui/base/l10n/l10n_util.h"
22 23
23 using content::WebContents; 24 using content::WebContents;
25 using content::WebUIMessageHandler;
24 26
25 namespace { 27 namespace {
26 28
27 static const int kPageIdOffset = 10; 29 static const int kPageIdOffset = 10;
28 static const int kIndexMask = (1 << kPageIdOffset) - 1; 30 static const int kIndexMask = (1 << kPageIdOffset) - 1;
29 31
30 // TODO(xiyuan): Merge this with the one on ntp_resource_cache. 32 // TODO(xiyuan): Merge this with the one on ntp_resource_cache.
31 string16 GetUrlWithLang(const GURL& url) { 33 string16 GetUrlWithLang(const GURL& url) {
32 return ASCIIToUTF16(google_util::AppendGoogleLocaleParam(url).spec()); 34 return ASCIIToUTF16(google_util::AppendGoogleLocaleParam(url).spec());
33 } 35 }
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 ExtensionService* service = GetProfile()->GetExtensionService(); 127 ExtensionService* service = GetProfile()->GetExtensionService();
126 if (service) 128 if (service)
127 AddMessageHandler(new AppLauncherHandler(service)); 129 AddMessageHandler(new AppLauncherHandler(service));
128 130
129 // Set up the source. 131 // Set up the source.
130 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); 132 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
131 PrefService* prefs = profile->GetPrefs(); 133 PrefService* prefs = profile->GetPrefs();
132 profile->GetChromeURLDataManager()->AddDataSource( 134 profile->GetChromeURLDataManager()->AddDataSource(
133 CreateAppListUIHTMLSource(prefs)); 135 CreateAppListUIHTMLSource(prefs));
134 } 136 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/active_downloads_ui.cc ('k') | chrome/browser/ui/webui/bug_report_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698