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

Side by Side Diff: chrome/browser/chromeos/login/user_image_view.cc

Issue 8142026: Revert 104076 - Change std::wstring to string16 for views::Link (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 2 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/chromeos/login/user_image_view.h" 5 #include "chrome/browser/chromeos/login/user_image_view.h"
6 6
7 #include <string>
8
9 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
11 #include "chrome/browser/chromeos/login/default_images_view.h" 9 #include "chrome/browser/chromeos/login/default_images_view.h"
12 #include "chrome/browser/chromeos/login/default_user_images.h" 10 #include "chrome/browser/chromeos/login/default_user_images.h"
13 #include "chrome/browser/chromeos/login/helper.h" 11 #include "chrome/browser/chromeos/login/helper.h"
14 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" 12 #include "chrome/browser/chromeos/login/rounded_rect_painter.h"
15 #include "chrome/browser/chromeos/login/user_manager.h" 13 #include "chrome/browser/chromeos/login/user_manager.h"
16 #include "chrome/browser/policy/browser_policy_connector.h" 14 #include "chrome/browser/policy/browser_policy_connector.h"
17 #include "grit/generated_resources.h" 15 #include "grit/generated_resources.h"
18 #include "grit/theme_resources.h" 16 #include "grit/theme_resources.h"
(...skipping 23 matching lines...) Expand all
42 const int kVerticalPadding = 10; 40 const int kVerticalPadding = 10;
43 // Color for splitter separating contents from OK button. 41 // Color for splitter separating contents from OK button.
44 const SkColor kSplitterColor = SkColorSetRGB(187, 195, 200); 42 const SkColor kSplitterColor = SkColorSetRGB(187, 195, 200);
45 // Height for the splitter. 43 // Height for the splitter.
46 const int kSplitterHeight = 1; 44 const int kSplitterHeight = 1;
47 45
48 // IDs of column sets for grid layout manager. 46 // IDs of column sets for grid layout manager.
49 enum ColumnSets { 47 enum ColumnSets {
50 kTitleRow, // Column set for screen title. 48 kTitleRow, // Column set for screen title.
51 kImagesRow, // Column set for image from camera and snapshot button. 49 kImagesRow, // Column set for image from camera and snapshot button.
52 kSplitterRow, // Place for the splitter. 50 kSplitterRow, // Place for the splitter.
53 kButtonsRow, // Column set for OK button. 51 kButtonsRow, // Column set for OK button.
54 }; 52 };
55 53
56 views::View* CreateSplitter(const SkColor& color) { 54 views::View* CreateSplitter(const SkColor& color) {
57 views::View* splitter = new views::View(); 55 views::View* splitter = new views::View();
58 splitter->set_background(views::Background::CreateSolidBackground(color)); 56 splitter->set_background(views::Background::CreateSolidBackground(color));
59 return splitter; 57 return splitter;
60 } 58 }
61 59
62 } // namespace 60 } // namespace
(...skipping 12 matching lines...) Expand all
75 UserImageView::~UserImageView() { 73 UserImageView::~UserImageView() {
76 } 74 }
77 75
78 void UserImageView::Init() { 76 void UserImageView::Init() {
79 // Use rounded rect background. 77 // Use rounded rect background.
80 set_border(CreateWizardBorder(&BorderDefinition::kScreenBorder)); 78 set_border(CreateWizardBorder(&BorderDefinition::kScreenBorder));
81 views::Painter* painter = CreateWizardPainter( 79 views::Painter* painter = CreateWizardPainter(
82 &BorderDefinition::kScreenBorder); 80 &BorderDefinition::kScreenBorder);
83 set_background(views::Background::CreateBackgroundPainter(true, painter)); 81 set_background(views::Background::CreateBackgroundPainter(true, painter));
84 82
85 title_label_ = new views::Label( 83 title_label_ = new views::Label(UTF16ToWide(
86 l10n_util::GetStringUTF16(IDS_OPTIONS_CHANGE_PICTURE_DIALOG_TEXT)); 84 l10n_util::GetStringUTF16(IDS_OPTIONS_CHANGE_PICTURE_DIALOG_TEXT)));
87 title_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); 85 title_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
88 title_label_->SetMultiLine(true); 86 title_label_->SetMultiLine(true);
89 CorrectLabelFontSize(title_label_); 87 CorrectLabelFontSize(title_label_);
90 88
91 default_images_view_ = new DefaultImagesView(this); 89 default_images_view_ = new DefaultImagesView(this);
92 take_photo_view_ = new TakePhotoView(this); 90 take_photo_view_ = new TakePhotoView(this);
93 take_photo_view_->set_show_title(false); 91 take_photo_view_->set_show_title(false);
94 92
95 splitter_ = CreateSplitter(kSplitterColor); 93 splitter_ = CreateSplitter(kSplitterColor);
96 94
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 return; 284 return;
287 delegate_->StopCamera(); 285 delegate_->StopCamera();
288 ok_button_->SetEnabled(true); 286 ok_button_->SetEnabled(true);
289 ok_button_->RequestFocus(); 287 ok_button_->RequestFocus();
290 take_photo_view_->SetImage( 288 take_photo_view_->SetImage(
291 ResourceBundle::GetSharedInstance().GetBitmapNamed( 289 ResourceBundle::GetSharedInstance().GetBitmapNamed(
292 kDefaultImageResources[image_index])); 290 kDefaultImageResources[image_index]));
293 } 291 }
294 292
295 } // namespace chromeos 293 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/user_controller.cc ('k') | chrome/browser/chromeos/login/user_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698