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

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

Issue 2228713003: mash: Convert ShelfView to wm common types, clean up Shelf access (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix control reaches end of non-void function warnings Created 4 years, 4 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/first_run/first_run_ui.h" 5 #include "chrome/browser/ui/webui/chromeos/first_run/first_run_ui.h"
6 6
7 #include "ash/shelf/shelf.h" 7 #include "ash/shelf/shelf.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 l10n_util::GetStringUTF16(IDS_FIRST_RUN_HELP_STEP_KEEP_EXPLORING_BUTTON)); 54 l10n_util::GetStringUTF16(IDS_FIRST_RUN_HELP_STEP_KEEP_EXPLORING_BUTTON));
55 localized_strings->SetString( 55 localized_strings->SetString(
56 "helpFinishButton", 56 "helpFinishButton",
57 l10n_util::GetStringUTF16(IDS_FIRST_RUN_HELP_STEP_FINISH_BUTTON)); 57 l10n_util::GetStringUTF16(IDS_FIRST_RUN_HELP_STEP_FINISH_BUTTON));
58 localized_strings->SetString( 58 localized_strings->SetString(
59 "nextButton", l10n_util::GetStringUTF16(IDS_FIRST_RUN_NEXT_BUTTON)); 59 "nextButton", l10n_util::GetStringUTF16(IDS_FIRST_RUN_NEXT_BUTTON));
60 localized_strings->SetBoolean( 60 localized_strings->SetBoolean(
61 "transitionsEnabled", 61 "transitionsEnabled",
62 base::CommandLine::ForCurrentProcess()->HasSwitch( 62 base::CommandLine::ForCurrentProcess()->HasSwitch(
63 chromeos::switches::kEnableFirstRunUITransitions)); 63 chromeos::switches::kEnableFirstRunUITransitions));
64 const std::string& shelf_alignment = 64 std::string shelf_alignment;
65 ash::Shelf::ForPrimaryDisplay()->SelectValueForShelfAlignment( 65 switch (ash::Shelf::ForPrimaryDisplay()->alignment()) {
66 kShelfAlignmentBottom, kShelfAlignmentLeft, kShelfAlignmentRight); 66 case ash::SHELF_ALIGNMENT_BOTTOM:
67 case ash::SHELF_ALIGNMENT_BOTTOM_LOCKED:
68 shelf_alignment = kShelfAlignmentBottom;
69 break;
70 case ash::SHELF_ALIGNMENT_LEFT:
71 shelf_alignment = kShelfAlignmentLeft;
72 break;
73 case ash::SHELF_ALIGNMENT_RIGHT:
74 shelf_alignment = kShelfAlignmentRight;
75 break;
76 }
67 localized_strings->SetString("shelfAlignment", shelf_alignment); 77 localized_strings->SetString("shelfAlignment", shelf_alignment);
68 } 78 }
69 79
70 content::WebUIDataSource* CreateDataSource() { 80 content::WebUIDataSource* CreateDataSource() {
71 content::WebUIDataSource* source = 81 content::WebUIDataSource* source =
72 content::WebUIDataSource::Create(chrome::kChromeUIFirstRunHost); 82 content::WebUIDataSource::Create(chrome::kChromeUIFirstRunHost);
73 source->SetJsonPath("strings.js"); 83 source->SetJsonPath("strings.js");
74 source->SetDefaultResource(IDR_FIRST_RUN_HTML); 84 source->SetDefaultResource(IDR_FIRST_RUN_HTML);
75 source->AddResourcePath(kFirstRunJSPath, IDR_FIRST_RUN_JS); 85 source->AddResourcePath(kFirstRunJSPath, IDR_FIRST_RUN_JS);
76 base::DictionaryValue localized_strings; 86 base::DictionaryValue localized_strings;
(...skipping 12 matching lines...) Expand all
89 : WebUIController(web_ui), 99 : WebUIController(web_ui),
90 actor_(NULL) { 100 actor_(NULL) {
91 FirstRunHandler* handler = new FirstRunHandler(); 101 FirstRunHandler* handler = new FirstRunHandler();
92 actor_ = handler; 102 actor_ = handler;
93 web_ui->AddMessageHandler(handler); 103 web_ui->AddMessageHandler(handler);
94 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), CreateDataSource()); 104 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), CreateDataSource());
95 } 105 }
96 106
97 } // namespace chromeos 107 } // namespace chromeos
98 108
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698