OLD | NEW |
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/common/shelf/shelf.h" | |
8 #include "ash/common/shelf/wm_shelf.h" | 7 #include "ash/common/shelf/wm_shelf.h" |
| 8 #include "ash/common/wm_shell.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/browser/ui/webui/chromeos/first_run/first_run_handler.h" | 12 #include "chrome/browser/ui/webui/chromeos/first_run/first_run_handler.h" |
13 #include "chrome/common/url_constants.h" | 13 #include "chrome/common/url_constants.h" |
14 #include "chrome/grit/browser_resources.h" | 14 #include "chrome/grit/browser_resources.h" |
15 #include "chrome/grit/chromium_strings.h" | 15 #include "chrome/grit/chromium_strings.h" |
16 #include "chrome/grit/generated_resources.h" | 16 #include "chrome/grit/generated_resources.h" |
17 #include "chromeos/chromeos_switches.h" | 17 #include "chromeos/chromeos_switches.h" |
18 #include "content/public/browser/web_ui.h" | 18 #include "content/public/browser/web_ui.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 l10n_util::GetStringUTF16(IDS_FIRST_RUN_HELP_STEP_KEEP_EXPLORING_BUTTON)); | 55 l10n_util::GetStringUTF16(IDS_FIRST_RUN_HELP_STEP_KEEP_EXPLORING_BUTTON)); |
56 localized_strings->SetString( | 56 localized_strings->SetString( |
57 "helpFinishButton", | 57 "helpFinishButton", |
58 l10n_util::GetStringUTF16(IDS_FIRST_RUN_HELP_STEP_FINISH_BUTTON)); | 58 l10n_util::GetStringUTF16(IDS_FIRST_RUN_HELP_STEP_FINISH_BUTTON)); |
59 localized_strings->SetString( | 59 localized_strings->SetString( |
60 "nextButton", l10n_util::GetStringUTF16(IDS_FIRST_RUN_NEXT_BUTTON)); | 60 "nextButton", l10n_util::GetStringUTF16(IDS_FIRST_RUN_NEXT_BUTTON)); |
61 localized_strings->SetBoolean( | 61 localized_strings->SetBoolean( |
62 "transitionsEnabled", | 62 "transitionsEnabled", |
63 base::CommandLine::ForCurrentProcess()->HasSwitch( | 63 base::CommandLine::ForCurrentProcess()->HasSwitch( |
64 chromeos::switches::kEnableFirstRunUITransitions)); | 64 chromeos::switches::kEnableFirstRunUITransitions)); |
| 65 ash::WmShelf* shelf = |
| 66 ash::WmShelf::ForWindow(ash::WmShell::Get()->GetPrimaryRootWindow()); |
65 std::string shelf_alignment; | 67 std::string shelf_alignment; |
66 switch (ash::Shelf::ForPrimaryDisplay()->wm_shelf()->alignment()) { | 68 switch (shelf->alignment()) { |
67 case ash::SHELF_ALIGNMENT_BOTTOM: | 69 case ash::SHELF_ALIGNMENT_BOTTOM: |
68 case ash::SHELF_ALIGNMENT_BOTTOM_LOCKED: | 70 case ash::SHELF_ALIGNMENT_BOTTOM_LOCKED: |
69 shelf_alignment = kShelfAlignmentBottom; | 71 shelf_alignment = kShelfAlignmentBottom; |
70 break; | 72 break; |
71 case ash::SHELF_ALIGNMENT_LEFT: | 73 case ash::SHELF_ALIGNMENT_LEFT: |
72 shelf_alignment = kShelfAlignmentLeft; | 74 shelf_alignment = kShelfAlignmentLeft; |
73 break; | 75 break; |
74 case ash::SHELF_ALIGNMENT_RIGHT: | 76 case ash::SHELF_ALIGNMENT_RIGHT: |
75 shelf_alignment = kShelfAlignmentRight; | 77 shelf_alignment = kShelfAlignmentRight; |
76 break; | 78 break; |
(...skipping 23 matching lines...) Expand all Loading... |
100 : WebUIController(web_ui), | 102 : WebUIController(web_ui), |
101 actor_(NULL) { | 103 actor_(NULL) { |
102 FirstRunHandler* handler = new FirstRunHandler(); | 104 FirstRunHandler* handler = new FirstRunHandler(); |
103 actor_ = handler; | 105 actor_ = handler; |
104 web_ui->AddMessageHandler(handler); | 106 web_ui->AddMessageHandler(handler); |
105 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), CreateDataSource()); | 107 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), CreateDataSource()); |
106 } | 108 } |
107 | 109 |
108 } // namespace chromeos | 110 } // namespace chromeos |
109 | 111 |
OLD | NEW |