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

Side by Side Diff: chrome/browser/ui/webui/uber/uber_ui.cc

Issue 9124028: separate about page into its own page (included in chrome://chrome) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: change indent, move script includes to inside body 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
« no previous file with comments | « chrome/browser/ui/webui/options2/options_ui2.cc ('k') | chrome/chrome_browser.gypi » ('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) 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 #include "chrome/browser/ui/webui/uber/uber_ui.h" 5 #include "chrome/browser/ui/webui/uber/uber_ui.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" 10 #include "chrome/browser/ui/webui/chrome_url_data_manager.h"
(...skipping 22 matching lines...) Expand all
33 source->AddLocalizedString("shortProductName", IDS_SHORT_PRODUCT_NAME); 33 source->AddLocalizedString("shortProductName", IDS_SHORT_PRODUCT_NAME);
34 34
35 source->AddString("settingsHost", 35 source->AddString("settingsHost",
36 ASCIIToUTF16(chrome::kChromeUISettingsHost)); 36 ASCIIToUTF16(chrome::kChromeUISettingsHost));
37 source->AddLocalizedString("settingsDisplayName", IDS_SETTINGS_TITLE); 37 source->AddLocalizedString("settingsDisplayName", IDS_SETTINGS_TITLE);
38 source->AddString("extensionsHost", 38 source->AddString("extensionsHost",
39 ASCIIToUTF16(chrome::kChromeUIExtensionsHost)); 39 ASCIIToUTF16(chrome::kChromeUIExtensionsHost));
40 source->AddLocalizedString("extensionsDisplayName", 40 source->AddLocalizedString("extensionsDisplayName",
41 IDS_MANAGE_EXTENSIONS_SETTING_WINDOWS_TITLE); 41 IDS_MANAGE_EXTENSIONS_SETTING_WINDOWS_TITLE);
42 42
43 #if defined(OS_CHROMEOS)
44 source->AddString("aboutPageHost",
45 ASCIIToUTF16(chrome::kAboutOptionsSubPage));
46 source->AddLocalizedString("aboutPageDisplayName", IDS_ABOUT_TAB_TITLE);
47 #endif
43 return source; 48 return source;
44 } 49 }
45 50
46 } // namespace 51 } // namespace
47 52
48 UberUI::UberUI(WebContents* contents) : WebUI(contents) { 53 UberUI::UberUI(WebContents* contents) : WebUI(contents) {
49 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); 54 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
50 profile->GetChromeURLDataManager()->AddDataSource(CreateUberHTMLSource()); 55 profile->GetChromeURLDataManager()->AddDataSource(CreateUberHTMLSource());
51 56
52 RegisterSubpage(chrome::kChromeUISettingsFrameURL); 57 RegisterSubpage(chrome::kChromeUISettingsFrameURL);
53 RegisterSubpage(chrome::kChromeUIExtensionsFrameURL); 58 RegisterSubpage(chrome::kChromeUIExtensionsFrameURL);
59 #if defined(OS_CHROMEOS)
60 RegisterSubpage(chrome::kChromeUIAboutPageFrameURL);
61 #endif
54 } 62 }
55 63
56 UberUI::~UberUI() { 64 UberUI::~UberUI() {
57 STLDeleteValues(&sub_uis_); 65 STLDeleteValues(&sub_uis_);
58 } 66 }
59 67
60 void UberUI::RegisterSubpage(const std::string& page_url) { 68 void UberUI::RegisterSubpage(const std::string& page_url) {
61 WebUI* web_ui = ChromeWebUIFactory::GetInstance()->CreateWebUIForURL( 69 WebUI* web_ui = ChromeWebUIFactory::GetInstance()->CreateWebUIForURL(
62 web_contents_, GURL(page_url)); 70 web_contents_, GURL(page_url));
63 71
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 SubpageMap::iterator subpage = sub_uis_.find(source_url.GetOrigin().spec()); 107 SubpageMap::iterator subpage = sub_uis_.find(source_url.GetOrigin().spec());
100 if (subpage == sub_uis_.end()) { 108 if (subpage == sub_uis_.end()) {
101 // The message was sent from the uber page itself. 109 // The message was sent from the uber page itself.
102 DCHECK_EQ(std::string(chrome::kChromeUIUberHost), source_url.host()); 110 DCHECK_EQ(std::string(chrome::kChromeUIUberHost), source_url.host());
103 WebUI::OnWebUISend(source_url, message, args); 111 WebUI::OnWebUISend(source_url, message, args);
104 } else { 112 } else {
105 // The message was sent from a subpage. 113 // The message was sent from a subpage.
106 subpage->second->OnWebUISend(source_url, message, args); 114 subpage->second->OnWebUISend(source_url, message, args);
107 } 115 }
108 } 116 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options2/options_ui2.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698