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

Side by Side Diff: chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc

Issue 10387010: Select theme resources from ResourceBundle at requested scale factor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with master. Created 8 years, 7 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) 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/chromeos/mobile_setup_ui.h" 5 #include "chrome/browser/ui/webui/chromeos/mobile_setup_ui.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 26 matching lines...) Expand all
37 #include "content/public/browser/render_view_host_observer.h" 37 #include "content/public/browser/render_view_host_observer.h"
38 #include "content/public/browser/web_contents.h" 38 #include "content/public/browser/web_contents.h"
39 #include "content/public/browser/web_ui.h" 39 #include "content/public/browser/web_ui.h"
40 #include "content/public/browser/web_ui_message_handler.h" 40 #include "content/public/browser/web_ui_message_handler.h"
41 #include "googleurl/src/gurl.h" 41 #include "googleurl/src/gurl.h"
42 #include "grit/browser_resources.h" 42 #include "grit/browser_resources.h"
43 #include "grit/chromium_strings.h" 43 #include "grit/chromium_strings.h"
44 #include "grit/generated_resources.h" 44 #include "grit/generated_resources.h"
45 #include "grit/locale_settings.h" 45 #include "grit/locale_settings.h"
46 #include "ui/base/l10n/l10n_util.h" 46 #include "ui/base/l10n/l10n_util.h"
47 #include "ui/base/layout.h"
47 #include "ui/base/resource/resource_bundle.h" 48 #include "ui/base/resource/resource_bundle.h"
48 49
49 using content::BrowserThread; 50 using content::BrowserThread;
50 using content::RenderViewHost; 51 using content::RenderViewHost;
51 using content::WebContents; 52 using content::WebContents;
52 using content::WebUIMessageHandler; 53 using content::WebUIMessageHandler;
53 54
54 namespace { 55 namespace {
55 56
56 // Host page JS API function names. 57 // Host page JS API function names.
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 strings.SetString("cancel_button", 477 strings.SetString("cancel_button",
477 l10n_util::GetStringUTF16(IDS_CANCEL)); 478 l10n_util::GetStringUTF16(IDS_CANCEL));
478 strings.SetString("ok_button", 479 strings.SetString("ok_button",
479 l10n_util::GetStringUTF16(IDS_OK)); 480 l10n_util::GetStringUTF16(IDS_OK));
480 strings.SetString("cancel_question", 481 strings.SetString("cancel_question",
481 l10n_util::GetStringUTF16(IDS_MOBILE_CANCEL_ACTIVATION)); 482 l10n_util::GetStringUTF16(IDS_MOBILE_CANCEL_ACTIVATION));
482 SetFontAndTextDirection(&strings); 483 SetFontAndTextDirection(&strings);
483 484
484 static const base::StringPiece html( 485 static const base::StringPiece html(
485 ResourceBundle::GetSharedInstance().GetRawDataResource( 486 ResourceBundle::GetSharedInstance().GetRawDataResource(
486 IDR_MOBILE_SETUP_PAGE_HTML)); 487 IDR_MOBILE_SETUP_PAGE_HTML, ui::SCALE_FACTOR_NONE));
487 488
488 std::string full_html = jstemplate_builder::GetI18nTemplateHtml(html, 489 std::string full_html = jstemplate_builder::GetI18nTemplateHtml(html,
489 &strings); 490 &strings);
490 491
491 SendResponse(request_id, base::RefCountedString::TakeString(&full_html)); 492 SendResponse(request_id, base::RefCountedString::TakeString(&full_html));
492 } 493 }
493 494
494 //////////////////////////////////////////////////////////////////////////////// 495 ////////////////////////////////////////////////////////////////////////////////
495 // 496 //
496 // MobileSetupHandler 497 // MobileSetupHandler
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after
1403 1404
1404 // Set up the chrome://mobilesetup/ source. 1405 // Set up the chrome://mobilesetup/ source.
1405 Profile* profile = Profile::FromWebUI(web_ui); 1406 Profile* profile = Profile::FromWebUI(web_ui);
1406 ChromeURLDataManager::AddDataSource(profile, html_source); 1407 ChromeURLDataManager::AddDataSource(profile, html_source);
1407 } 1408 }
1408 1409
1409 void MobileSetupUI::RenderViewCreated(RenderViewHost* host) { 1410 void MobileSetupUI::RenderViewCreated(RenderViewHost* host) {
1410 // Destroyed by the corresponding RenderViewHost 1411 // Destroyed by the corresponding RenderViewHost
1411 new PortalFrameLoadObserver(AsWeakPtr(), host); 1412 new PortalFrameLoadObserver(AsWeakPtr(), host);
1412 } 1413 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698