summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authormaruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-10 17:39:46 +0000
committermaruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-10 17:39:46 +0000
commit72d1e597c85fbf6b45756e3c753696370c48c042 (patch)
treed01609d62295e34aa3a5721d4109f815d0fd23ad /chrome
parent9475d1d189c03a0626c4855b38f6004bfe7c5bb8 (diff)
downloadchromium_src-72d1e597c85fbf6b45756e3c753696370c48c042.zip
chromium_src-72d1e597c85fbf6b45756e3c753696370c48c042.tar.gz
chromium_src-72d1e597c85fbf6b45756e3c753696370c48c042.tar.bz2
Slight code change to make some global variables const.
Fix >80 cols lines. Review URL: http://codereview.chromium.org/42013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11342 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rwxr-xr-xchrome/tools/build/win/dependencies.py12
-rw-r--r--chrome/tools/crash_service/crash_service.h7
-rw-r--r--chrome/tools/profiles/generate_profile.cc4
-rw-r--r--chrome/views/bitmap_scroll_bar.cc3
-rw-r--r--chrome/views/bitmap_scroll_bar.h25
-rw-r--r--chrome/views/chrome_menu.cc14
-rw-r--r--chrome/views/combo_box.cc4
-rw-r--r--chrome/views/event.cc3
-rw-r--r--chrome/views/grid_layout.h2
-rw-r--r--chrome/views/grid_layout_unittest.cc8
-rw-r--r--chrome/views/label.h4
-rw-r--r--chrome/views/native_scroll_bar.cc4
-rw-r--r--chrome/views/painter.h8
-rw-r--r--chrome/views/text_button.cc55
-rw-r--r--chrome/views/tooltip_manager.cc3
-rw-r--r--chrome/views/widget_win.h10
-rw-r--r--chrome/views/window.cc27
-rw-r--r--chrome/worker/webworkerclient_proxy.cc3
-rw-r--r--chrome/worker/worker_thread.cc3
19 files changed, 122 insertions, 77 deletions
diff --git a/chrome/tools/build/win/dependencies.py b/chrome/tools/build/win/dependencies.py
index 06ce64c..353c89c 100755
--- a/chrome/tools/build/win/dependencies.py
+++ b/chrome/tools/build/win/dependencies.py
@@ -157,11 +157,12 @@ def VerifyDependents(pe_name, dependents, delay_loaded, list_file, verbose):
except:
raise Error("Failed to load " + list_file)
- # The dependency files have dependencies in two section - dependents and delay_loaded
- # Also various distributions of Chromium can have different dependencies. So first
- # we read generic dependencies ("dependents" and "delay_loaded"). If distribution
- # specific dependencies exist (i.e. "dependents_google_chrome" and
- # "delay_loaded_google_chrome") we use those instead.
+ # The dependency files have dependencies in two section - dependents and
+ # delay_loaded. Also various distributions of Chromium can have different
+ # dependencies. So first we read generic dependencies ("dependents" and
+ # "delay_loaded"). If distribution specific dependencies exist
+ # (i.e. "dependents_google_chrome" and "delay_loaded_google_chrome") we use
+ # those instead.
distribution = DIST_DEFAULT
if DIST_ENV_VAR in os.environ.keys():
distribution = os.environ[DIST_ENV_VAR].lower()
@@ -222,4 +223,3 @@ if '__main__' == __name__:
if len(args) != 2:
option_parser.error("Incorrect number of arguments")
sys.exit(main(options, args))
-
diff --git a/chrome/tools/crash_service/crash_service.h b/chrome/tools/crash_service/crash_service.h
index 0edee38..0c022bd 100644
--- a/chrome/tools/crash_service/crash_service.h
+++ b/chrome/tools/crash_service/crash_service.h
@@ -80,9 +80,10 @@ class CrashService {
static void OnClientConnected(void* context,
const google_breakpad::ClientInfo* client_info);
- static void OnClientDumpRequest(void* context,
- const google_breakpad::ClientInfo* client_info,
- const std::wstring* file_path);
+ static void OnClientDumpRequest(
+ void* context,
+ const google_breakpad::ClientInfo* client_info,
+ const std::wstring* file_path);
static void OnClientExited(void* context,
const google_breakpad::ClientInfo* client_info);
diff --git a/chrome/tools/profiles/generate_profile.cc b/chrome/tools/profiles/generate_profile.cc
index 6e99e45..bd75b31 100644
--- a/chrome/tools/profiles/generate_profile.cc
+++ b/chrome/tools/profiles/generate_profile.cc
@@ -120,8 +120,8 @@ void InsertURLBatch(const std::wstring& profile_dir, int page_id,
PageTransition::Type transition = PageTransition::TYPED;
const int end_page_id = page_id + batch_size;
for (; page_id < end_page_id; ++page_id) {
- // Randomly decide whether this new URL simulates following a link or whether
- // it's a jump to a new URL.
+ // Randomly decide whether this new URL simulates following a link or
+ // whether it's a jump to a new URL.
if (!previous_url.is_empty() && RandomFloat() < kFollowLinkProbability) {
transition = PageTransition::LINK;
} else {
diff --git a/chrome/views/bitmap_scroll_bar.cc b/chrome/views/bitmap_scroll_bar.cc
index d919dc8..686954d 100644
--- a/chrome/views/bitmap_scroll_bar.cc
+++ b/chrome/views/bitmap_scroll_bar.cc
@@ -221,7 +221,8 @@ class BitmapScrollBarThumb : public View {
// Returns the bitmap that is rendered in the middle of the thumb
// transparently over the background bitmap.
SkBitmap* grippy_bitmap() const {
- return scroll_bar_->images_[BitmapScrollBar::THUMB_GRIPPY][BaseButton::BS_NORMAL];
+ return scroll_bar_->images_[BitmapScrollBar::THUMB_GRIPPY]
+ [BaseButton::BS_NORMAL];
}
// Update our state and schedule a repaint when the mouse moves over us.
diff --git a/chrome/views/bitmap_scroll_bar.h b/chrome/views/bitmap_scroll_bar.h
index 71e079d..453c55f 100644
--- a/chrome/views/bitmap_scroll_bar.h
+++ b/chrome/views/bitmap_scroll_bar.h
@@ -45,15 +45,22 @@ class BitmapScrollBar : public ScrollBar,
// A list of parts that the user may supply bitmaps for.
enum ScrollBarPart {
- PREV_BUTTON = 0, // The button used to represent scrolling up/left by 1 line.
- NEXT_BUTTON, // The button used to represent scrolling down/right by 1 line.
- // IMPORTANT: The code assumes the prev and next
- // buttons have equal width and equal height.
- THUMB_START_CAP, // The top/left segment of the thumb on the scrollbar.
- THUMB_MIDDLE, // The tiled background image of the thumb.
- THUMB_END_CAP, // The bottom/right segment of the thumb on the scrollbar.
- THUMB_GRIPPY, // The grippy that is rendered in the center of the thumb.
- THUMB_TRACK, // The tiled background image of the thumb track.
+ // The button used to represent scrolling up/left by 1 line.
+ PREV_BUTTON = 0,
+ // The button used to represent scrolling down/right by 1 line.
+ // IMPORTANT: The code assumes the prev and next
+ // buttons have equal width and equal height.
+ NEXT_BUTTON,
+ // The top/left segment of the thumb on the scrollbar.
+ THUMB_START_CAP,
+ // The tiled background image of the thumb.
+ THUMB_MIDDLE,
+ // The bottom/right segment of the thumb on the scrollbar.
+ THUMB_END_CAP,
+ // The grippy that is rendered in the center of the thumb.
+ THUMB_GRIPPY,
+ // The tiled background image of the thumb track.
+ THUMB_TRACK,
PART_COUNT
};
diff --git a/chrome/views/chrome_menu.cc b/chrome/views/chrome_menu.cc
index 96b24dc..6c038a5 100644
--- a/chrome/views/chrome_menu.cc
+++ b/chrome/views/chrome_menu.cc
@@ -1428,7 +1428,8 @@ void MenuItemView::Paint(ChromeCanvas* canvas, bool for_drag) {
height() };
gutter_bounds.right = gutter_bounds.left + gutter_width;
AdjustBoundsForRTLUI(&gutter_bounds);
- NativeTheme::instance()->PaintMenuGutter(dc, MENU_POPUPGUTTER, MPI_NORMAL, &gutter_bounds);
+ NativeTheme::instance()->PaintMenuGutter(dc, MENU_POPUPGUTTER, MPI_NORMAL,
+ &gutter_bounds);
}
// Render the background.
@@ -1474,7 +1475,8 @@ void MenuItemView::Paint(ChromeCanvas* canvas, bool for_drag) {
int default_sys_color = render_selection ? COLOR_HIGHLIGHTTEXT :
(IsEnabled() ? COLOR_MENUTEXT : COLOR_GRAYTEXT);
SkColor fg_color = NativeTheme::instance()->GetThemeColorWithDefault(
- NativeTheme::MENU, MENU_POPUPITEM, state, TMT_TEXTCOLOR, default_sys_color);
+ NativeTheme::MENU, MENU_POPUPITEM, state, TMT_TEXTCOLOR,
+ default_sys_color);
int width = this->width() - item_right_margin - label_start;
ChromeFont& font = GetRootMenuItem()->font_;
gfx::Rect text_bounds(label_start, top_margin, width, font.height());
@@ -1506,8 +1508,12 @@ void MenuItemView::Paint(ChromeCanvas* canvas, bool for_drag) {
if (HasSubmenu()) {
int state_id = IsEnabled() ? MSM_NORMAL : MSM_DISABLED;
- RECT arrow_bounds = { this->width() - item_right_margin + kLabelToArrowPadding,
- 0, 0, height() };
+ RECT arrow_bounds = {
+ this->width() - item_right_margin + kLabelToArrowPadding,
+ 0,
+ 0,
+ height()
+ };
arrow_bounds.right = arrow_bounds.left + arrow_width;
AdjustBoundsForRTLUI(&arrow_bounds);
diff --git a/chrome/views/combo_box.cc b/chrome/views/combo_box.cc
index 49b1d0f..ec3d682 100644
--- a/chrome/views/combo_box.cc
+++ b/chrome/views/combo_box.cc
@@ -51,8 +51,8 @@ gfx::Size ComboBox::GetPreferredSize() {
// to the corner of rcItem. It does not seem to be queryable from the theme.
// It is consistent on all versions of Windows from 2K to Vista, and is
// invariant with respect to the combobox border size. We could conceivably
- // get this number from rect_item.x, but it seems fragile to depend on position
- // here, inside of the layout code.
+ // get this number from rect_item.x, but it seems fragile to depend on
+ // position here, inside of the layout code.
const int kItemOffset = 3;
int item_to_button_distance = std::max(kItemOffset - border.width(), 0);
diff --git a/chrome/views/event.cc b/chrome/views/event.cc
index 5a3d42b..5a6081b 100644
--- a/chrome/views/event.cc
+++ b/chrome/views/event.cc
@@ -79,7 +79,8 @@ MouseEvent::MouseEvent(const MouseEvent& model, View* from, View* to)
int KeyEvent::GetKeyStateFlags() const {
// Windows Keyboard messages don't come with control key state as parameters
- // like mouse messages do, so we need to explicitly probe for these key states.
+ // like mouse messages do, so we need to explicitly probe for these key
+ // states.
int flags = 0;
if (GetKeyState(VK_MENU) & 0x80)
flags |= Event::EF_ALT_DOWN;
diff --git a/chrome/views/grid_layout.h b/chrome/views/grid_layout.h
index da67638..706f380 100644
--- a/chrome/views/grid_layout.h
+++ b/chrome/views/grid_layout.h
@@ -136,7 +136,7 @@ class GridLayout : public LayoutManager {
// As a convenience this adds the view to the host. The view becomes owned
// by the host, and NOT this GridLayout.
void AddView(View* view, int col_span, int row_span, Alignment h_align,
- Alignment v_align);
+ Alignment v_align);
// Adds a view with the specified alignment and spans. If
// pref_width/pref_height is > 0 then the preferred width/height of the view
diff --git a/chrome/views/grid_layout_unittest.cc b/chrome/views/grid_layout_unittest.cc
index 08e8d28..ed52ed0 100644
--- a/chrome/views/grid_layout_unittest.cc
+++ b/chrome/views/grid_layout_unittest.cc
@@ -387,9 +387,11 @@ TEST_F(GridLayoutTest, FixedSize) {
for (int i = 0; i < column_count; ++i) {
for (int row = 0; row < row_count; ++row) {
View* view = host.GetChildViewAt(row * column_count + i);
- ExpectViewBoundsEquals(2 + title_width * i + (title_width - pref_width) / 2,
- 2 + pref_height * row,
- pref_width, pref_height, view);
+ ExpectViewBoundsEquals(
+ 2 + title_width * i + (title_width - pref_width) / 2,
+ 2 + pref_height * row,
+ pref_width,
+ pref_height, view);
}
}
diff --git a/chrome/views/label.h b/chrome/views/label.h
index d70ff3a..d50b977 100644
--- a/chrome/views/label.h
+++ b/chrome/views/label.h
@@ -139,8 +139,8 @@ class Label : public View {
// it is returned instead.
virtual bool GetTooltipText(int x, int y, std::wstring* tooltip);
- // Mouse enter/exit are overridden to render mouse over background color. These
- // invoke SetContainsMouse as necessary.
+ // Mouse enter/exit are overridden to render mouse over background color.
+ // These invoke SetContainsMouse as necessary.
virtual void OnMouseMoved(const MouseEvent& e);
virtual void OnMouseEntered(const MouseEvent& event);
virtual void OnMouseExited(const MouseEvent& event);
diff --git a/chrome/views/native_scroll_bar.cc b/chrome/views/native_scroll_bar.cc
index 5694d52..3bc2c7f 100644
--- a/chrome/views/native_scroll_bar.cc
+++ b/chrome/views/native_scroll_bar.cc
@@ -248,7 +248,9 @@ gfx::Size NativeScrollBar::GetPreferredSize() {
return gfx::Size(GetLayoutSize(), 0);
}
-void NativeScrollBar::Update(int viewport_size, int content_size, int current_pos) {
+void NativeScrollBar::Update(int viewport_size,
+ int content_size,
+ int current_pos) {
ScrollBar::Update(viewport_size, content_size, current_pos);
if (!sb_container_)
return;
diff --git a/chrome/views/painter.h b/chrome/views/painter.h
index a934124..55ec664 100644
--- a/chrome/views/painter.h
+++ b/chrome/views/painter.h
@@ -81,10 +81,10 @@ class ImagePainter : public Painter {
DISALLOW_EVIL_CONSTRUCTORS(ImagePainter);
};
-// HorizontalPainter paints 3 images into a box: left, center and right. The left
-// and right images are drawn to size at the left/right edges of the region.
-// The center is tiled in the remaining space. All images must have the same
-// height.
+// HorizontalPainter paints 3 images into a box: left, center and right. The
+// left and right images are drawn to size at the left/right edges of the
+// region. The center is tiled in the remaining space. All images must have the
+// same height.
class HorizontalPainter : public Painter {
public:
// Constructs a new HorizontalPainter loading the specified image names.
diff --git a/chrome/views/text_button.cc b/chrome/views/text_button.cc
index 72420c9..5c2e663 100644
--- a/chrome/views/text_button.cc
+++ b/chrome/views/text_button.cc
@@ -86,40 +86,55 @@ void TextButtonBorder::Paint(const View& view, ChromeCanvas* canvas) const {
canvas->DrawBitmapInt(*set->top_left, 0, 0);
// Tile the top image
- canvas->TileImageInt(*set->top,
- set->top_left->width(), 0,
- bounds.width() - set->top_right->width() - set->top_left->width(),
- set->top->height());
+ canvas->TileImageInt(
+ *set->top,
+ set->top_left->width(),
+ 0,
+ bounds.width() - set->top_right->width() - set->top_left->width(),
+ set->top->height());
// Draw the top right image
canvas->DrawBitmapInt(*set->top_right,
bounds.width() - set->top_right->width(), 0);
// Tile the left image
- canvas->TileImageInt(*set->left,
- 0, set->top_left->height(),
- set->top_left->width(),
- bounds.height() - set->top->height() - set->bottom_left->height());
+ canvas->TileImageInt(
+ *set->left,
+ 0,
+ set->top_left->height(),
+ set->top_left->width(),
+ bounds.height() - set->top->height() - set->bottom_left->height());
// Tile the center image
- canvas->TileImageInt(*set->center,
- set->left->width(), set->top->height(),
- bounds.width() - set->right->width() - set->left->width(),
- bounds.height() - set->bottom->height() - set->top->height());
+ canvas->TileImageInt(
+ *set->center,
+ set->left->width(),
+ set->top->height(),
+ bounds.width() - set->right->width() - set->left->width(),
+ bounds.height() - set->bottom->height() - set->top->height());
// Tile the right image
- canvas->TileImageInt(*set->right,
- bounds.width() - set->right->width(), set->top_right->height(),
- bounds.width(), bounds.height() - set->bottom_right->height() - set->top_right->height());
+ canvas->TileImageInt(
+ *set->right,
+ bounds.width() - set->right->width(),
+ set->top_right->height(),
+ bounds.width(),
+ bounds.height() - set->bottom_right->height() -
+ set->top_right->height());
// Draw the bottom left image
- canvas->DrawBitmapInt(*set->bottom_left, 0, bounds.height() - set->bottom_left->height());
+ canvas->DrawBitmapInt(*set->bottom_left,
+ 0,
+ bounds.height() - set->bottom_left->height());
// Tile the bottom image
- canvas->TileImageInt(*set->bottom,
- set->bottom_left->width(), bounds.height() - set->bottom->height(),
- bounds.width() - set->bottom_right->width() - set->bottom_left->width(),
- set->bottom->height());
+ canvas->TileImageInt(
+ *set->bottom,
+ set->bottom_left->width(),
+ bounds.height() - set->bottom->height(),
+ bounds.width() - set->bottom_right->width() -
+ set->bottom_left->width(),
+ set->bottom->height());
// Draw the bottom right image
canvas->DrawBitmapInt(*set->bottom_right,
diff --git a/chrome/views/tooltip_manager.cc b/chrome/views/tooltip_manager.cc
index 1de156b..5a38c53 100644
--- a/chrome/views/tooltip_manager.cc
+++ b/chrome/views/tooltip_manager.cc
@@ -290,7 +290,8 @@ void TooltipManager::TrimTooltipToFit(std::wstring* text,
gfx::Point screen_loc(position_x, position_y);
View::ConvertPointToScreen(widget_->GetRootView(), &screen_loc);
gfx::Rect monitor_bounds =
- win_util::GetMonitorBoundsForRect(gfx::Rect(screen_loc.x(), screen_loc.y(),
+ win_util::GetMonitorBoundsForRect(gfx::Rect(screen_loc.x(),
+ screen_loc.y(),
0, 0));
RECT tooltip_margin;
SendMessage(window, TTM_GETMARGIN, 0, (LPARAM)&tooltip_margin);
diff --git a/chrome/views/widget_win.h b/chrome/views/widget_win.h
index 55ee4fd..4ec5acb 100644
--- a/chrome/views/widget_win.h
+++ b/chrome/views/widget_win.h
@@ -408,8 +408,14 @@ class WidgetWin : public Widget,
virtual LRESULT OnMouseWheel(UINT flags, short distance, const CPoint& point);
virtual LRESULT OnMouseRange(UINT msg, WPARAM w_param, LPARAM l_param);
virtual LRESULT OnNCActivate(BOOL active) { SetMsgHandled(FALSE); return 0; }
- virtual LRESULT OnNCCalcSize(BOOL w_param, LPARAM l_param) { SetMsgHandled(FALSE); return 0; }
- virtual LRESULT OnNCHitTest(const CPoint& pt) { SetMsgHandled(FALSE); return 0; }
+ virtual LRESULT OnNCCalcSize(BOOL w_param, LPARAM l_param) {
+ SetMsgHandled(FALSE);
+ return 0;
+ }
+ virtual LRESULT OnNCHitTest(const CPoint& pt) {
+ SetMsgHandled(FALSE);
+ return 0;
+ }
virtual void OnNCLButtonDblClk(UINT flags, const CPoint& point);
virtual void OnNCLButtonDown(UINT flags, const CPoint& point);
virtual void OnNCLButtonUp(UINT flags, const CPoint& point);
diff --git a/chrome/views/window.cc b/chrome/views/window.cc
index a3359bf..fb5ce76 100644
--- a/chrome/views/window.cc
+++ b/chrome/views/window.cc
@@ -233,7 +233,8 @@ void Window::UpdateWindowTitle() {
}
void Window::UpdateWindowIcon() {
- // If the non-client view is rendering its own icon, we need to tell it to repaint.
+ // If the non-client view is rendering its own icon, we need to tell it to
+ // repaint.
non_client_view_->SchedulePaint();
// Update the native frame's icon. We do this regardless of whether or not
@@ -697,18 +698,18 @@ void Window::OnNCLButtonDown(UINT ht_component, const CPoint& point) {
case HTCLOSE:
case HTMINBUTTON:
case HTMAXBUTTON: {
- // When the mouse is pressed down in these specific non-client areas, we
- // need to tell the RootView to send the mouse pressed event (which sets
- // capture, allowing subsequent WM_LBUTTONUP (note, _not_ WM_NCLBUTTONUP)
- // to fire so that the appropriate WM_SYSCOMMAND can be sent by the
- // applicable button's ButtonListener. We _have_ to do this this way
- // rather than letting Windows just send the syscommand itself (as would
- // happen if we never did this dance) because for some insane reason
- // DefWindowProc for WM_NCLBUTTONDOWN also renders the pressed window
- // control button appearance, in the Windows classic style, over our
- // view! Ick! By handling this message we prevent Windows from doing this
- // undesirable thing, but that means we need to roll the sys-command
- // handling ourselves.
+ // When the mouse is pressed down in these specific non-client areas,
+ // we need to tell the RootView to send the mouse pressed event (which
+ // sets capture, allowing subsequent WM_LBUTTONUP (note, _not_
+ // WM_NCLBUTTONUP) to fire so that the appropriate WM_SYSCOMMAND can be
+ // sent by the applicable button's ButtonListener. We _have_ to do this
+ // way rather than letting Windows just send the syscommand itself (as
+ // would happen if we never did this dance) because for some insane
+ // reason DefWindowProc for WM_NCLBUTTONDOWN also renders the pressed
+ // window control button appearance, in the Windows classic style, over
+ // our view! Ick! By handling this message we prevent Windows from
+ // doing this undesirable thing, but that means we need to roll the
+ // sys-command handling ourselves.
ProcessNCMousePress(point, MK_LBUTTON);
return;
}
diff --git a/chrome/worker/webworkerclient_proxy.cc b/chrome/worker/webworkerclient_proxy.cc
index 9e3917c0..7b351b0 100644
--- a/chrome/worker/webworkerclient_proxy.cc
+++ b/chrome/worker/webworkerclient_proxy.cc
@@ -47,7 +47,8 @@ void WebWorkerClientProxy::PostConsoleMessageToWorkerObject(
route_id_, destination, source, level,message, line_number, source_url));
}
-void WebWorkerClientProxy::ConfirmMessageFromWorkerObject(bool has_pending_activity) {
+void WebWorkerClientProxy::ConfirmMessageFromWorkerObject(
+ bool has_pending_activity) {
Send(new WorkerHostMsg_ConfirmMessageFromWorkerObject(
route_id_, has_pending_activity));
}
diff --git a/chrome/worker/worker_thread.cc b/chrome/worker/worker_thread.cc
index 298f9db..b986fcd 100644
--- a/chrome/worker/worker_thread.cc
+++ b/chrome/worker/worker_thread.cc
@@ -12,7 +12,8 @@
#include "WebKit.h"
WorkerThread::WorkerThread()
- : ChildThread(base::Thread::Options(MessageLoop::TYPE_DEFAULT, kV8StackSize)) {
+ : ChildThread(base::Thread::Options(MessageLoop::TYPE_DEFAULT,
+ kV8StackSize)) {
}
WorkerThread::~WorkerThread() {