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

Side by Side Diff: views/controls/scrollbar/bitmap_scroll_bar.cc

Issue 113612: Make views/ use strings from app_strings. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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
« no previous file with comments | « views/controls/message_box_view.cc ('k') | views/controls/text_field.cc » ('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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "views/controls/scrollbar/bitmap_scroll_bar.h" 5 #include "views/controls/scrollbar/bitmap_scroll_bar.h"
6 6
7 #include "app/gfx/canvas.h" 7 #include "app/gfx/canvas.h"
8 #include "app/l10n_util.h" 8 #include "app/l10n_util.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
11 #include "grit/generated_resources.h" 11 #include "grit/app_strings.h"
12 #include "third_party/skia/include/core/SkBitmap.h" 12 #include "third_party/skia/include/core/SkBitmap.h"
13 #include "views/controls/menu/menu.h" 13 #include "views/controls/menu/menu.h"
14 #include "views/controls/scroll_view.h" 14 #include "views/controls/scroll_view.h"
15 #include "views/widget/widget.h" 15 #include "views/widget/widget.h"
16 16
17 #undef min 17 #undef min
18 #undef max 18 #undef max
19 19
20 namespace views { 20 namespace views {
21 21
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollNext); 554 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollNext);
555 menu->RunMenuAt(x, y); 555 menu->RunMenuAt(x, y);
556 } 556 }
557 557
558 /////////////////////////////////////////////////////////////////////////////// 558 ///////////////////////////////////////////////////////////////////////////////
559 // BitmapScrollBar, Menu::Delegate implementation: 559 // BitmapScrollBar, Menu::Delegate implementation:
560 560
561 std::wstring BitmapScrollBar::GetLabel(int id) const { 561 std::wstring BitmapScrollBar::GetLabel(int id) const {
562 switch (id) { 562 switch (id) {
563 case ScrollBarContextMenuCommand_ScrollHere: 563 case ScrollBarContextMenuCommand_ScrollHere:
564 return l10n_util::GetString(IDS_SCROLLBAR_CXMENU_SCROLLHERE); 564 return l10n_util::GetString(IDS_APP_SCROLLBAR_CXMENU_SCROLLHERE);
565 case ScrollBarContextMenuCommand_ScrollStart: 565 case ScrollBarContextMenuCommand_ScrollStart:
566 if (IsHorizontal()) 566 if (IsHorizontal())
567 return l10n_util::GetString(IDS_SCROLLBAR_CXMENU_SCROLLLEFTEDGE); 567 return l10n_util::GetString(IDS_APP_SCROLLBAR_CXMENU_SCROLLLEFTEDGE);
568 return l10n_util::GetString(IDS_SCROLLBAR_CXMENU_SCROLLHOME); 568 return l10n_util::GetString(IDS_APP_SCROLLBAR_CXMENU_SCROLLHOME);
569 case ScrollBarContextMenuCommand_ScrollEnd: 569 case ScrollBarContextMenuCommand_ScrollEnd:
570 if (IsHorizontal()) 570 if (IsHorizontal())
571 return l10n_util::GetString(IDS_SCROLLBAR_CXMENU_SCROLLRIGHTEDGE); 571 return l10n_util::GetString(IDS_APP_SCROLLBAR_CXMENU_SCROLLRIGHTEDGE);
572 return l10n_util::GetString(IDS_SCROLLBAR_CXMENU_SCROLLEND); 572 return l10n_util::GetString(IDS_APP_SCROLLBAR_CXMENU_SCROLLEND);
573 case ScrollBarContextMenuCommand_ScrollPageUp: 573 case ScrollBarContextMenuCommand_ScrollPageUp:
574 if (IsHorizontal()) 574 if (IsHorizontal())
575 return l10n_util::GetString(IDS_SCROLLBAR_CXMENU_SCROLLPAGEUP); 575 return l10n_util::GetString(IDS_APP_SCROLLBAR_CXMENU_SCROLLPAGEUP);
576 return l10n_util::GetString(IDS_SCROLLBAR_CXMENU_SCROLLPAGEUP); 576 return l10n_util::GetString(IDS_APP_SCROLLBAR_CXMENU_SCROLLPAGEUP);
577 case ScrollBarContextMenuCommand_ScrollPageDown: 577 case ScrollBarContextMenuCommand_ScrollPageDown:
578 if (IsHorizontal()) 578 if (IsHorizontal())
579 return l10n_util::GetString(IDS_SCROLLBAR_CXMENU_SCROLLPAGEDOWN); 579 return l10n_util::GetString(IDS_APP_SCROLLBAR_CXMENU_SCROLLPAGEDOWN);
580 return l10n_util::GetString(IDS_SCROLLBAR_CXMENU_SCROLLPAGEDOWN); 580 return l10n_util::GetString(IDS_APP_SCROLLBAR_CXMENU_SCROLLPAGEDOWN);
581 case ScrollBarContextMenuCommand_ScrollPrev: 581 case ScrollBarContextMenuCommand_ScrollPrev:
582 if (IsHorizontal()) 582 if (IsHorizontal())
583 return l10n_util::GetString(IDS_SCROLLBAR_CXMENU_SCROLLLEFT); 583 return l10n_util::GetString(IDS_APP_SCROLLBAR_CXMENU_SCROLLLEFT);
584 return l10n_util::GetString(IDS_SCROLLBAR_CXMENU_SCROLLUP); 584 return l10n_util::GetString(IDS_APP_SCROLLBAR_CXMENU_SCROLLUP);
585 case ScrollBarContextMenuCommand_ScrollNext: 585 case ScrollBarContextMenuCommand_ScrollNext:
586 if (IsHorizontal()) 586 if (IsHorizontal())
587 return l10n_util::GetString(IDS_SCROLLBAR_CXMENU_SCROLLRIGHT); 587 return l10n_util::GetString(IDS_APP_SCROLLBAR_CXMENU_SCROLLRIGHT);
588 return l10n_util::GetString(IDS_SCROLLBAR_CXMENU_SCROLLDOWN); 588 return l10n_util::GetString(IDS_APP_SCROLLBAR_CXMENU_SCROLLDOWN);
589 } 589 }
590 NOTREACHED() << "Invalid BitmapScrollBar Context Menu command!"; 590 NOTREACHED() << "Invalid BitmapScrollBar Context Menu command!";
591 return L""; 591 return L"";
592 } 592 }
593 593
594 bool BitmapScrollBar::IsCommandEnabled(int id) const { 594 bool BitmapScrollBar::IsCommandEnabled(int id) const {
595 switch (id) { 595 switch (id) {
596 case ScrollBarContextMenuCommand_ScrollPageUp: 596 case ScrollBarContextMenuCommand_ScrollPageUp:
597 case ScrollBarContextMenuCommand_ScrollPageDown: 597 case ScrollBarContextMenuCommand_ScrollPageDown:
598 return !IsHorizontal(); 598 return !IsHorizontal();
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 thumb_position = thumb_position - (thumb_->GetSize() / 2); 698 thumb_position = thumb_position - (thumb_->GetSize() / 2);
699 return (thumb_position * contents_size_) / GetTrackSize(); 699 return (thumb_position * contents_size_) / GetTrackSize();
700 } 700 }
701 701
702 void BitmapScrollBar::SetThumbTrackState(CustomButton::ButtonState state) { 702 void BitmapScrollBar::SetThumbTrackState(CustomButton::ButtonState state) {
703 thumb_track_state_ = state; 703 thumb_track_state_ = state;
704 SchedulePaint(); 704 SchedulePaint();
705 } 705 }
706 706
707 } // namespace views 707 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/message_box_view.cc ('k') | views/controls/text_field.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698