summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/automation/ui_controls.cc2
-rw-r--r--chrome/browser/bookmarks/bookmark_storage.h192
-rw-r--r--chrome/browser/debugger/debugger_view.cc2
-rw-r--r--chrome/browser/find_in_page_controller.cc2
-rw-r--r--chrome/browser/find_in_page_view.cc32
-rw-r--r--chrome/browser/history_view.cc26
-rw-r--r--chrome/browser/native_ui_contents.cc16
-rw-r--r--chrome/browser/views/about_chrome_view.cc6
-rw-r--r--chrome/browser/views/bookmark_bar_view.cc106
-rw-r--r--chrome/browser/views/bookmark_bar_view_test.cc14
-rw-r--r--chrome/browser/views/clear_browsing_data.cc32
-rw-r--r--chrome/browser/views/constrained_window_impl.cc33
-rw-r--r--chrome/browser/views/download_item_view.cc15
-rw-r--r--chrome/browser/views/download_shelf_view.cc20
-rw-r--r--chrome/browser/views/download_tab_view.cc23
-rw-r--r--chrome/browser/views/first_run_bubble.cc8
-rw-r--r--chrome/browser/views/first_run_customize_view.cc16
-rw-r--r--chrome/browser/views/first_run_view.cc20
-rw-r--r--chrome/browser/views/first_run_view_base.cc4
-rw-r--r--chrome/browser/views/frame/aero_glass_frame.cc2
-rw-r--r--chrome/browser/views/frame/aero_glass_non_client_view.cc26
-rw-r--r--chrome/browser/views/frame/browser_view.cc4
-rw-r--r--chrome/browser/views/frame/browser_view2.cc38
-rw-r--r--chrome/browser/views/frame/browser_window_factory.cc134
-rw-r--r--chrome/browser/views/frame/opaque_non_client_view.cc59
-rw-r--r--chrome/browser/views/hwnd_html_view.cc104
-rw-r--r--chrome/browser/views/hwnd_html_view.h118
-rw-r--r--chrome/browser/views/importer_lock_view.cc4
-rw-r--r--chrome/browser/views/info_bar_item_view.cc9
-rw-r--r--chrome/browser/views/info_bar_view.cc23
-rw-r--r--chrome/browser/views/info_bubble.cc14
-rw-r--r--chrome/browser/views/location_bar_view.cc47
-rw-r--r--chrome/browser/views/old_frames/frame_view.cc10
-rw-r--r--chrome/browser/views/old_frames/simple_vista_frame.cc16
-rw-r--r--chrome/browser/views/old_frames/simple_xp_frame.cc50
-rw-r--r--chrome/browser/views/old_frames/vista_frame.cc46
-rw-r--r--chrome/browser/views/old_frames/xp_frame.cc101
-rw-r--r--chrome/browser/views/old_frames/xp_frame.h2
-rw-r--r--chrome/browser/views/options/advanced_contents_view.cc8
-rw-r--r--chrome/browser/views/options/content_page_view.cc6
-rw-r--r--chrome/browser/views/options/cookies_view.cc2
-rw-r--r--chrome/browser/views/options/fonts_languages_window_view.cc4
-rw-r--r--chrome/browser/views/options/fonts_page_view.cc4
-rw-r--r--chrome/browser/views/options/languages_page_view.cc2
-rw-r--r--chrome/browser/views/options/options_group_view.cc6
-rw-r--r--chrome/browser/views/options/options_window_view.cc4
-rw-r--r--chrome/browser/views/page_info_window.cc12
-rw-r--r--chrome/browser/views/sad_tab_view.cc14
-rw-r--r--chrome/browser/views/star_toggle.cc8
-rw-r--r--chrome/browser/views/tab_icon_view.cc6
-rw-r--r--chrome/browser/views/tabs/tab.cc4
-rw-r--r--chrome/browser/views/tabs/tab_renderer.cc28
-rw-r--r--chrome/browser/views/tabs/tab_strip.cc46
-rw-r--r--chrome/browser/views/toolbar_star_toggle.cc4
-rw-r--r--chrome/browser/views/toolbar_view.cc22
55 files changed, 763 insertions, 793 deletions
diff --git a/chrome/browser/automation/ui_controls.cc b/chrome/browser/automation/ui_controls.cc
index 0eb4202..9fe42201 100644
--- a/chrome/browser/automation/ui_controls.cc
+++ b/chrome/browser/automation/ui_controls.cc
@@ -336,7 +336,7 @@ void MoveMouseToCenterAndPress(
ChromeViews::View* view, MouseButton button, int state, Task* task) {
DCHECK(view);
DCHECK(view->GetViewContainer());
- CPoint view_center(view->GetWidth() / 2, view->GetHeight() / 2);
+ CPoint view_center(view->width() / 2, view->height() / 2);
ChromeViews::View::ConvertPointToScreen(view, &view_center);
SendMouseMove(view_center.x, view_center.y);
SendMouseEventsNotifyWhenDone(button, state, task);
diff --git a/chrome/browser/bookmarks/bookmark_storage.h b/chrome/browser/bookmarks/bookmark_storage.h
index 6ec4184..c645a7f 100644
--- a/chrome/browser/bookmarks/bookmark_storage.h
+++ b/chrome/browser/bookmarks/bookmark_storage.h
@@ -1,96 +1,96 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_STORAGE_H_
-#define CHROME_BROWSER_BOOKMARKS_BOOKMARK_STORAGE_H_
-
-#include "base/ref_counted.h"
-#include "base/task.h"
-#include "chrome/browser/browser_process.h"
-
-class BookmarkModel;
-class Profile;
-class Value;
-
-// BookmarkStorage handles reading/write the bookmark bar model. The
-// BookmarkModel uses the BookmarkStorage to load bookmarks from disk, as well
-// as notifying the BookmarkStorage every time the model changes.
-//
-// Internally BookmarkStorage uses BookmarkCodec to do the actual read/write.
-
-class BookmarkStorage : public base::RefCountedThreadSafe<BookmarkStorage> {
- friend class BookmarkStorageBackend;
-
- public:
- // Creates a BookmarkStorage for the specified model
- BookmarkStorage(Profile* profile, BookmarkModel* model);
-
- // Loads the bookmarks into the model, notifying the model when done. If
- // load_from_history is true, the bookmarks are loaded from the file written
- // by history (StarredURLDatabase).
- void LoadBookmarks(bool load_from_history);
-
- // Schedules saving the bookmark bar model to disk.
- void ScheduleSave();
-
- // Notification the bookmark bar model is going to be deleted. If there is
- // a pending save, it is saved immediately.
- void BookmarkModelDeleted();
-
- private:
- // Callback from backend with the results of the bookmark file.
- void LoadedBookmarks(Value* root_value,
- bool bookmark_file_exists,
- bool loaded_from_history);
-
- // Schedules a save on the backend thread.
- void SaveNow();
-
- // Returns the thread the backend is run on.
- base::Thread* backend_thread() const { return backend_thread_; }
-
- // The model. The model is NULL once BookmarkModelDeleted has been invoked.
- BookmarkModel* model_;
-
- // Used to delay saves.
- ScopedRunnableMethodFactory<BookmarkStorage> save_factory_;
-
- // The backend handles actual reading/writing to disk.
- scoped_refptr<BookmarkStorageBackend> backend_;
-
- // Thread read/writing is run on. This comes from the profile, and is null
- // during testing.
- base::Thread* backend_thread_;
-
- DISALLOW_COPY_AND_ASSIGN(BookmarkStorage);
-};
-
-// Used to save the bookmarks on the file thread.
-class BookmarkStorageBackend :
- public base::RefCountedThreadSafe<BookmarkStorageBackend> {
- public:
- explicit BookmarkStorageBackend(const std::wstring& path,
- const std::wstring& tmp_histor_path);
-
- // Writes the specified value to disk. This takes ownership of |value| and
- // deletes it when done.
- void Write(Value* value);
-
- // Reads the bookmarks from kBookmarksFileName. Notifies |service| with
- // the results on the specified MessageLoop.
- void Read(scoped_refptr<BookmarkStorage> service,
- MessageLoop* message_loop,
- bool load_from_history);
-
- private:
- // Path we read/write to.
- const std::wstring path_;
-
- // Path bookmarks are read from if asked to load from history file.
- const std::wstring tmp_history_path_;
-
- DISALLOW_COPY_AND_ASSIGN(BookmarkStorageBackend);
-};
-
-#endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_STORAGE_H_
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_STORAGE_H_
+#define CHROME_BROWSER_BOOKMARKS_BOOKMARK_STORAGE_H_
+
+#include "base/ref_counted.h"
+#include "base/task.h"
+#include "chrome/browser/browser_process.h"
+
+class BookmarkModel;
+class Profile;
+class Value;
+
+// BookmarkStorage handles reading/write the bookmark bar model. The
+// BookmarkModel uses the BookmarkStorage to load bookmarks from disk, as well
+// as notifying the BookmarkStorage every time the model changes.
+//
+// Internally BookmarkStorage uses BookmarkCodec to do the actual read/write.
+
+class BookmarkStorage : public base::RefCountedThreadSafe<BookmarkStorage> {
+ friend class BookmarkStorageBackend;
+
+ public:
+ // Creates a BookmarkStorage for the specified model
+ BookmarkStorage(Profile* profile, BookmarkModel* model);
+
+ // Loads the bookmarks into the model, notifying the model when done. If
+ // load_from_history is true, the bookmarks are loaded from the file written
+ // by history (StarredURLDatabase).
+ void LoadBookmarks(bool load_from_history);
+
+ // Schedules saving the bookmark bar model to disk.
+ void ScheduleSave();
+
+ // Notification the bookmark bar model is going to be deleted. If there is
+ // a pending save, it is saved immediately.
+ void BookmarkModelDeleted();
+
+ private:
+ // Callback from backend with the results of the bookmark file.
+ void LoadedBookmarks(Value* root_value,
+ bool bookmark_file_exists,
+ bool loaded_from_history);
+
+ // Schedules a save on the backend thread.
+ void SaveNow();
+
+ // Returns the thread the backend is run on.
+ base::Thread* backend_thread() const { return backend_thread_; }
+
+ // The model. The model is NULL once BookmarkModelDeleted has been invoked.
+ BookmarkModel* model_;
+
+ // Used to delay saves.
+ ScopedRunnableMethodFactory<BookmarkStorage> save_factory_;
+
+ // The backend handles actual reading/writing to disk.
+ scoped_refptr<BookmarkStorageBackend> backend_;
+
+ // Thread read/writing is run on. This comes from the profile, and is null
+ // during testing.
+ base::Thread* backend_thread_;
+
+ DISALLOW_COPY_AND_ASSIGN(BookmarkStorage);
+};
+
+// Used to save the bookmarks on the file thread.
+class BookmarkStorageBackend :
+ public base::RefCountedThreadSafe<BookmarkStorageBackend> {
+ public:
+ explicit BookmarkStorageBackend(const std::wstring& path,
+ const std::wstring& tmp_histor_path);
+
+ // Writes the specified value to disk. This takes ownership of |value| and
+ // deletes it when done.
+ void Write(Value* value);
+
+ // Reads the bookmarks from kBookmarksFileName. Notifies |service| with
+ // the results on the specified MessageLoop.
+ void Read(scoped_refptr<BookmarkStorage> service,
+ MessageLoop* message_loop,
+ bool load_from_history);
+
+ private:
+ // Path we read/write to.
+ const std::wstring path_;
+
+ // Path bookmarks are read from if asked to load from history file.
+ const std::wstring tmp_history_path_;
+
+ DISALLOW_COPY_AND_ASSIGN(BookmarkStorageBackend);
+};
+
+#endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_STORAGE_H_
diff --git a/chrome/browser/debugger/debugger_view.cc b/chrome/browser/debugger/debugger_view.cc
index b65b021..494a23f 100644
--- a/chrome/browser/debugger/debugger_view.cc
+++ b/chrome/browser/debugger/debugger_view.cc
@@ -44,7 +44,7 @@ void DebuggerView::GetPreferredSize(CSize* out) {
}
void DebuggerView::Layout() {
- web_container_->SetBounds(0, 0, GetWidth(), GetHeight());
+ web_container_->SetBounds(0, 0, width(), height());
}
void DebuggerView::DidChangeBounds(const CRect& previous,
diff --git a/chrome/browser/find_in_page_controller.cc b/chrome/browser/find_in_page_controller.cc
index fabc772..baa4973 100644
--- a/chrome/browser/find_in_page_controller.cc
+++ b/chrome/browser/find_in_page_controller.cc
@@ -387,7 +387,7 @@ void FindInPageController::AnimationProgressed(
// First, we calculate how many pixels to slide the window.
find_dialog_animation_offset_ =
static_cast<int>((1.0 - animation_->GetCurrentValue()) *
- view_->GetHeight());
+ view_->height());
// This call makes sure it appears in the right location, the size and shape
// is correct and that it slides in the right direction.
diff --git a/chrome/browser/find_in_page_view.cc b/chrome/browser/find_in_page_view.cc
index 993ab64..c6507f4 100644
--- a/chrome/browser/find_in_page_view.cc
+++ b/chrome/browser/find_in_page_view.cc
@@ -342,26 +342,26 @@ void FindInPageView::Layout() {
// First we draw the close button on the far right.
close_button_->GetPreferredSize(&sz);
close_button_->SetBounds(panel_size.cx - sz.cx - kMarginRightOfCloseButton,
- (GetHeight() - sz.cy) / 2,
+ (height() - sz.cy) / 2,
sz.cx,
sz.cy);
close_button_->SetListener(this, CLOSE_TAG);
// Next, the FindNext button to the left the close button.
find_next_button_->GetPreferredSize(&sz);
- find_next_button_->SetBounds(close_button_->GetX() -
- find_next_button_->GetWidth() -
+ find_next_button_->SetBounds(close_button_->x() -
+ find_next_button_->width() -
kMarginLeftOfCloseButton,
- (GetHeight() - sz.cy) / 2,
+ (height() - sz.cy) / 2,
sz.cx,
sz.cy);
find_next_button_->SetListener(this, FIND_NEXT_TAG);
// Then, the FindPrevious button to the left the FindNext button.
find_previous_button_->GetPreferredSize(&sz);
- find_previous_button_->SetBounds(find_next_button_->GetX() -
- find_previous_button_->GetWidth(),
- (GetHeight() - sz.cy) / 2,
+ find_previous_button_->SetBounds(find_next_button_->x() -
+ find_previous_button_->width(),
+ (height() - sz.cy) / 2,
sz.cx,
sz.cy);
find_previous_button_->SetListener(this, FIND_PREVIOUS_TAG);
@@ -372,18 +372,18 @@ void FindInPageView::Layout() {
// of breathing room (margins around the text).
sz.cx += kMatchCountExtraWidth;
sz.cx = std::max(kMatchCountMinWidth, static_cast<int>(sz.cx));
- match_count_text_->SetBounds(find_previous_button_->GetX() -
+ match_count_text_->SetBounds(find_previous_button_->x() -
kWhiteSpaceAfterMatchCountLabel -
sz.cx,
- (GetHeight() - sz.cy) / 2 + 1,
+ (height() - sz.cy) / 2 + 1,
sz.cx,
sz.cy);
// And whatever space is left in between, gets filled up by the find edit box.
find_text_->GetPreferredSize(&sz);
- sz.cx = match_count_text_->GetX() - kMarginLeftOfFindTextField;
- find_text_->SetBounds(match_count_text_->GetX() - sz.cx,
- (GetHeight() - sz.cy) / 2 + 1,
+ sz.cx = match_count_text_->x() - kMarginLeftOfFindTextField;
+ find_text_->SetBounds(match_count_text_->x() - sz.cx,
+ (height() - sz.cy) / 2 + 1,
sz.cx,
sz.cy);
find_text_->SetController(this);
@@ -392,12 +392,12 @@ void FindInPageView::Layout() {
// The focus forwarder view is a hidden view that should cover the area
// between the find text box and the find button so that when the user clicks
// in that area we focus on the find text box.
- int find_text_edge = find_text_->GetX() + find_text_->GetWidth();
+ int find_text_edge = find_text_->x() + find_text_->width();
focus_forwarder_view_->SetBounds(find_text_edge,
- find_previous_button_->GetY(),
- find_previous_button_->GetX() -
+ find_previous_button_->y(),
+ find_previous_button_->x() -
find_text_edge,
- find_previous_button_->GetHeight());
+ find_previous_button_->height());
}
void FindInPageView::DidChangeBounds(const CRect& old_bounds,
diff --git a/chrome/browser/history_view.cc b/chrome/browser/history_view.cc
index 5add4fc..340280a 100644
--- a/chrome/browser/history_view.cc
+++ b/chrome/browser/history_view.cc
@@ -162,10 +162,10 @@ void SnippetRenderer::Paint(ChromeCanvas* canvas) {
const int width = ProcessRun(NULL, 0, 0,
match_iter, iter.prev(), iter.pos());
// Advance to the next line if necessary.
- if (x + width > GetWidth()) {
+ if (x + width > View::width()) {
x = 0;
y += line_height;
- if (y >= GetHeight())
+ if (y >= height())
return; // Out of vertical space.
}
ProcessRun(canvas, x, y, match_iter, iter.prev(), iter.pos());
@@ -209,7 +209,7 @@ int SnippetRenderer::ProcessRun(
if (canvas) {
canvas->DrawStringInt(run, *font, SkColorSetRGB(0, 0, 0),
x + total_width, y,
- width, GetHeight(),
+ width, height(),
ChromeCanvas::TEXT_VALIGN_BOTTOM);
}
@@ -338,7 +338,7 @@ HistoryItemRenderer::~HistoryItemRenderer() {
void HistoryItemRenderer::GetThumbnailBounds(CRect* rect) {
DCHECK(rect);
- rect->right = GetWidth() - kEntryPadding;
+ rect->right = width() - kEntryPadding;
rect->left = rect->right - kThumbnailWidth;
rect->top = kEntryPadding;
rect->bottom = rect->top + kThumbnailHeight;
@@ -421,7 +421,7 @@ void HistoryItemRenderer::Layout() {
GetThumbnailBounds(&thumbnail_rect);
max_x = thumbnail_rect.left - kEntryPadding;
} else {
- max_x = GetWidth() - kEntryPadding;
+ max_x = width() - kEntryPadding;
}
// Calculate the ideal positions of some items. If possible, we
@@ -564,8 +564,8 @@ void HistoryItemRenderer::StarStateChanged(bool state) {
// Shift the location to make the bubble appear at a visually pleasing
// location.
gfx::Rect star_bounds(star_location.x, star_location.y + 4,
- star_toggle_->GetWidth(),
- star_toggle_->GetHeight());
+ star_toggle_->width(),
+ star_toggle_->height());
HWND parent = GetViewContainer()->GetHWND();
Profile* profile = model_->profile();
GURL url = model_->GetURL(model_index_);
@@ -869,9 +869,7 @@ void HistoryView::Layout() {
kEntryPadding + kNoResultTextHeight);
}
- int x = GetX();
- int y = GetY();
- SetBounds(x, y, width, height);
+ SetBounds(x(), y(), width, height);
}
HistoryView::BreakOffsets::iterator HistoryView::GetBreakOffsetIteratorForY(
@@ -904,7 +902,7 @@ void HistoryView::Paint(ChromeCanvas* canvas) {
if (!canvas->getClipBounds(&clip))
return;
- const int content_width = GetWidth() - kLeftMargin - kRightMargin;
+ const int content_width = width() - kLeftMargin - kRightMargin;
const int x1 = kLeftMargin;
int clip_y = SkScalarRound(clip.fTop);
@@ -1114,7 +1112,7 @@ bool HistoryView::GetFloatingViewIDForPoint(int x, int y, int* id) {
// +--------------
// First, verify the x coordinate is within the correct region.
- if (x < kLeftMargin || x > GetWidth() - kRightMargin ||
+ if (x < kLeftMargin || x > width() - kRightMargin ||
y >= GetLastEntryMaxY()) {
return false;
}
@@ -1207,7 +1205,7 @@ ChromeViews::View* HistoryView::ValidateFloatingViewForID(int id) {
show_results_);
renderer->SetModel(model_.get(), model_index);
renderer->SetBounds(kLeftMargin, y,
- GetWidth() - kLeftMargin - kRightMargin,
+ width() - kLeftMargin - kRightMargin,
GetEntryHeight());
floating_view = renderer;
}
@@ -1312,7 +1310,7 @@ gfx::Rect HistoryView::CalculateDeleteControlBounds(int base_y) {
// the link. Additionally this should be baseline aligned with the date. I'm
// not doing that now as a redesign of HistoryView is in the works.
const int delete_width = GetDeleteControlWidth();
- const int delete_x = GetWidth() - kRightMargin - delete_width;
+ const int delete_x = width() - kRightMargin - delete_width;
return gfx::Rect(delete_x,
base_y + kDeleteControlOffset,
delete_width,
diff --git a/chrome/browser/native_ui_contents.cc b/chrome/browser/native_ui_contents.cc
index e4dce38..0a1dfad 100644
--- a/chrome/browser/native_ui_contents.cc
+++ b/chrome/browser/native_ui_contents.cc
@@ -285,8 +285,8 @@ bool NativeUIContents::NavigateToPendingEntry(bool reload) {
void NativeUIContents::Layout() {
if (current_view_) {
ChromeViews::RootView* root_view = GetRootView();
- current_view_->SetBounds(0, 0, root_view->GetWidth(),
- root_view->GetHeight());
+ current_view_->SetBounds(0, 0, root_view->width(),
+ root_view->height());
current_view_->Layout();
}
}
@@ -430,7 +430,7 @@ NativeUIBackground::~NativeUIBackground() {
void NativeUIBackground::Paint(ChromeCanvas* canvas,
ChromeViews::View* view) const {
static const SkColor kBackground = SkColorSetRGB(255, 255, 255);
- canvas->FillRectInt(kBackground, 0, 0, view->GetWidth(), view->GetHeight());
+ canvas->FillRectInt(kBackground, 0, 0, view->width(), view->height());
}
/////////////////////////////////////////////////////////////////////////////
@@ -605,7 +605,7 @@ void SearchableUIContainer::Layout() {
static_cast<int>(search_button_size.cx) +
kDestinationSmallerMargin;
- product_logo_->SetBounds(std::max(GetWidth() - kProductLogo->width() -
+ product_logo_->SetBounds(std::max(width() - kProductLogo->width() -
kProductLogoPadding,
field_width),
kProductLogoPadding,
@@ -615,13 +615,13 @@ void SearchableUIContainer::Layout() {
void SearchableUIContainer::Paint(ChromeCanvas* canvas) {
SkColor top_color(kBackground);
canvas->FillRectInt(top_color, 0, 0,
- GetWidth(), scroll_view_->GetY());
+ width(), scroll_view_->y());
- canvas->FillRectInt(kBottomMarginColor, 0, scroll_view_->GetY() -
- kBottomMargin, GetWidth(), kBottomMargin);
+ canvas->FillRectInt(kBottomMarginColor, 0, scroll_view_->y() -
+ kBottomMargin, width(), kBottomMargin);
canvas->FillRectInt(SkColorSetRGB(196, 196, 196),
- 0, scroll_view_->GetY() - 1, GetWidth(), 1);
+ 0, scroll_view_->y() - 1, width(), 1);
}
ChromeViews::TextField* SearchableUIContainer::GetSearchField() const {
diff --git a/chrome/browser/views/about_chrome_view.cc b/chrome/browser/views/about_chrome_view.cc
index 5d648a6..6ee840c 100644
--- a/chrome/browser/views/about_chrome_view.cc
+++ b/chrome/browser/views/about_chrome_view.cc
@@ -176,8 +176,8 @@ void AboutChromeView::Layout() {
// Then we have the version number right below it.
version_label_->GetPreferredSize(&sz);
version_label_->SetBounds(kPanelHorizMargin,
- about_title_label_->GetY() +
- about_title_label_->GetHeight() +
+ about_title_label_->y() +
+ about_title_label_->height() +
kRelatedControlVerticalSpacing,
kVersionFieldWidth,
sz.cy);
@@ -223,7 +223,7 @@ void AboutChromeView::Layout() {
// the throbber. We specify width to the end of the dialog because it contains
// variable length messages.
update_label_.GetPreferredSize(&sz);
- int update_label_x = throbber_->GetX() + throbber_->GetWidth() +
+ int update_label_x = throbber_->x() + throbber_->width() +
kRelatedControlHorizontalSpacing;
update_label_.SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT);
update_label_.SetBounds(update_label_x,
diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc
index 9de3d13..b7475ee 100644
--- a/chrome/browser/views/bookmark_bar_view.cc
+++ b/chrome/browser/views/bookmark_bar_view.cc
@@ -248,11 +248,11 @@ class BookmarkButton : public ChromeViews::TextButton {
paint.setAlpha(static_cast<int>(
(1.0 - show_animation_->GetCurrentValue()) * 255));
paint.setShader(gfx::CreateGradientShader(0,
- GetHeight() + kTopMargin + kBottomMargin,
+ height() + kTopMargin + kBottomMargin,
kTopBorderColor,
kBackgroundColor))->safeUnref();
- canvas->FillRectInt(0, -kTopMargin, GetWidth(),
- GetHeight() + kTopMargin + kBottomMargin, paint);
+ canvas->FillRectInt(0, -kTopMargin, width(),
+ height() + kTopMargin + kBottomMargin, paint);
}
virtual void AnimationProgressed(const Animation* animation) {
@@ -559,21 +559,21 @@ class ButtonSeparatorView : public ChromeViews::View {
virtual void Paint(ChromeCanvas* canvas) {
SkPaint paint;
paint.setShader(gfx::CreateGradientShader(0,
- GetHeight() / 2,
+ height() / 2,
kTopBorderColor,
kSeparatorColor))->safeUnref();
SkRect rc = {SkIntToScalar(kSeparatorStartX), SkIntToScalar(0),
- SkIntToScalar(1), SkIntToScalar(GetHeight() / 2) };
+ SkIntToScalar(1), SkIntToScalar(height() / 2) };
canvas->drawRect(rc, paint);
SkPaint paint_down;
- paint_down.setShader(gfx::CreateGradientShader(GetHeight() / 2,
- GetHeight(),
+ paint_down.setShader(gfx::CreateGradientShader(height() / 2,
+ height(),
kSeparatorColor,
kBackgroundColor))->safeUnref();
SkRect rc_down = {
- SkIntToScalar(kSeparatorStartX), SkIntToScalar(GetHeight() / 2),
- SkIntToScalar(1), SkIntToScalar(GetHeight() - 1) };
+ SkIntToScalar(kSeparatorStartX), SkIntToScalar(height() / 2),
+ SkIntToScalar(1), SkIntToScalar(height() - 1) };
canvas->drawRect(rc_down, paint_down);
}
@@ -717,8 +717,8 @@ void BookmarkBarView::Layout() {
// visible region and made invisible.
int x = kLeftMargin;
int y = kTopMargin;
- int width = GetWidth() - kRightMargin - kLeftMargin;
- int height = GetHeight() - kTopMargin - kBottomMargin;
+ int width = View::width() - kRightMargin - kLeftMargin;
+ int height = View::height() - kTopMargin - kBottomMargin;
int separator_margin = kSeparatorMargin;
if (IsNewTabPage()) {
@@ -799,7 +799,7 @@ void BookmarkBarView::DidChangeBounds(const CRect& previous,
void BookmarkBarView::ViewHierarchyChanged(bool is_add,
View* parent, View* child) {
- if (is_add && child == this && GetHeight() > 0) {
+ if (is_add && child == this && height() > 0) {
// We only layout while parented. When we become parented, if our bounds
// haven't changed, DidChangeBounds won't get invoked and we won't layout.
// Therefore we always force a layout when added.
@@ -808,15 +808,12 @@ void BookmarkBarView::ViewHierarchyChanged(bool is_add,
}
void BookmarkBarView::Paint(ChromeCanvas* canvas) {
- int width = GetWidth();
- int height = GetHeight();
-
if (IsNewTabPage() && (!IsAlwaysShown() || size_animation_->IsAnimating())) {
// Draw the background to match the new tab page.
- canvas->FillRectInt(kNewtabBackgroundColor, 0, 0, width, height);
+ canvas->FillRectInt(kNewtabBackgroundColor, 0, 0, width(), height());
// Draw the 'bottom' of the toolbar above our bubble.
- canvas->FillRectInt(kBottomBorderColor, 0, 0, width, 1);
+ canvas->FillRectInt(kBottomBorderColor, 0, 0, width(), 1);
SkRect rect;
@@ -832,8 +829,8 @@ void BookmarkBarView::Paint(ChromeCanvas* canvas) {
(kNewtabVerticalPadding) * current_state;
rect.set(SkDoubleToScalar(h_padding - 0.5),
SkDoubleToScalar(v_padding - 0.5),
- SkDoubleToScalar(width - h_padding - 0.5),
- SkDoubleToScalar(height - v_padding - 0.5));
+ SkDoubleToScalar(width() - h_padding - 0.5),
+ SkDoubleToScalar(height() - v_padding - 0.5));
double roundness = static_cast<double>
(kNewtabBarRoundness) * current_state;
@@ -842,7 +839,7 @@ void BookmarkBarView::Paint(ChromeCanvas* canvas) {
SkPaint paint;
paint.setAntiAlias(true);
paint.setShader(gfx::CreateGradientShader(0,
- height,
+ height(),
kTopBorderColor,
kBackgroundColor))->safeUnref();
@@ -862,13 +859,13 @@ void BookmarkBarView::Paint(ChromeCanvas* canvas) {
} else {
SkPaint paint;
paint.setShader(gfx::CreateGradientShader(0,
- height,
+ height(),
kTopBorderColor,
kBackgroundColor))->safeUnref();
- canvas->FillRectInt(0, 0, width, height, paint);
+ canvas->FillRectInt(0, 0, width(), height(), paint);
- canvas->FillRectInt(kTopBorderColor, 0, 0, width, 1);
- canvas->FillRectInt(kBottomBorderColor, 0, height - 1, width, 1);
+ canvas->FillRectInt(kTopBorderColor, 0, 0, width(), 1);
+ canvas->FillRectInt(kBottomBorderColor, 0, height() - 1, width(), 1);
}
}
@@ -882,20 +879,20 @@ void BookmarkBarView::PaintChildren(ChromeCanvas* canvas) {
DCHECK(index <= GetBookmarkButtonCount());
int x = 0;
int y = 0;
- int h = GetHeight();
+ int h = height();
if (index == GetBookmarkButtonCount()) {
if (index == 0) {
x = kLeftMargin;
} else {
- x = GetBookmarkButton(index - 1)->GetX() +
- GetBookmarkButton(index - 1)->GetWidth();
+ x = GetBookmarkButton(index - 1)->x() +
+ GetBookmarkButton(index - 1)->width();
}
} else {
- x = GetBookmarkButton(index)->GetX();
+ x = GetBookmarkButton(index)->x();
}
if (GetBookmarkButtonCount() > 0 && GetBookmarkButton(0)->IsVisible()) {
- y = GetBookmarkButton(0)->GetY();
- h = GetBookmarkButton(0)->GetHeight();
+ y = GetBookmarkButton(0)->y();
+ h = GetBookmarkButton(0)->height();
}
// Since the drop indicator is painted directly onto the canvas, we must
@@ -931,12 +928,12 @@ int BookmarkBarView::OnDragUpdated(const DropTargetEvent& event) {
return 0;
if (drop_info_->valid &&
- (drop_info_->x == event.GetX() && drop_info_->y == event.GetY())) {
+ (drop_info_->x == event.x() && drop_info_->y == event.y())) {
return drop_info_->drag_operation;
}
- drop_info_->x = event.GetX();
- drop_info_->y = event.GetY();
+ drop_info_->x = event.x();
+ drop_info_->y = event.y();
int drop_index;
bool drop_on;
@@ -1277,10 +1274,10 @@ void BookmarkBarView::WriteDragData(View* sender,
for (int i = 0; i < GetBookmarkButtonCount(); ++i) {
if (sender == GetBookmarkButton(i)) {
ChromeViews::TextButton* button = GetBookmarkButton(i);
- ChromeCanvas canvas(button->GetWidth(), button->GetHeight(), false);
+ ChromeCanvas canvas(button->width(), button->height(), false);
button->Paint(&canvas, true);
- drag_utils::SetDragImageOnDataObject(canvas, button->GetWidth(),
- button->GetHeight(), press_x,
+ drag_utils::SetDragImageOnDataObject(canvas, button->width(),
+ button->height(), press_x,
press_y, data);
WriteDragData(model_->GetBookmarkBarNode()->GetChild(i), data);
return;
@@ -1316,12 +1313,12 @@ void BookmarkBarView::RunMenu(ChromeViews::View* view,
// When we set the menu's position, we must take into account the mirrored
// position of the View relative to its parent. This can be easily done by
- // passing the right flag to View::GetX().
+ // passing the right flag to View::x().
int x = view->GetX(APPLY_MIRRORING_TRANSFORMATION);
- int height = GetHeight() - kMenuOffset;
+ int bar_height = height() - kMenuOffset;
if (IsNewTabPage() && !IsAlwaysShown())
- height -= kNewtabVerticalPadding;
+ bar_height -= kNewtabVerticalPadding;
int start_index = 0;
if (view == other_bookmarked_button_) {
@@ -1358,7 +1355,7 @@ void BookmarkBarView::RunMenu(ChromeViews::View* view,
HWND parent_hwnd = GetViewContainer()->GetHWND();
menu_runner_->RunMenuAt(parent_hwnd,
gfx::Rect(screen_loc.x, screen_loc.y,
- view->GetWidth(), height),
+ view->width(), bar_height),
anchor_point,
false);
}
@@ -1492,7 +1489,7 @@ void BookmarkBarView::ShowDropFolderForNode(BookmarkNode* node) {
// Note that both the anchor position and the position of the menu itself
// change depending on the locale. Also note that we must apply the
// mirroring transformation when querying for the child View bounds
- // (View::GetX(), specifically) so that we end up with the correct screen
+ // (View::x(), specifically) so that we end up with the correct screen
// coordinates if the View in question is mirrored.
MenuItemView::AnchorPosition anchor = MenuItemView::TOPLEFT;
if (node == model_->other_node()) {
@@ -1528,8 +1525,8 @@ void BookmarkBarView::ShowDropFolderForNode(BookmarkNode* node) {
drop_menu_runner_->RunMenuAt(
GetViewContainer()->GetHWND(),
gfx::Rect(screen_loc.x, screen_loc.y,
- view_to_position_menu_from->GetWidth(),
- view_to_position_menu_from->GetHeight()),
+ view_to_position_menu_from->width(),
+ view_to_position_menu_from->height()),
anchor, true);
}
@@ -1570,23 +1567,23 @@ int BookmarkBarView::CalculateDropOperation(const DropTargetEvent& event,
// right-to-left on RTL locales). Thus, in order to make sure the drop
// coordinates calculation works, we mirror the event's X coordinate if the
// locale is RTL.
- int mirrored_x = MirroredXCoordinateInsideView(event.GetX());
+ int mirrored_x = MirroredXCoordinateInsideView(event.x());
*index = -1;
*drop_on = false;
*is_over_other = *is_over_overflow = false;
- if (event.GetY() < other_bookmarked_button_->GetY() ||
- event.GetY() >= other_bookmarked_button_->GetY() +
- other_bookmarked_button_->GetHeight()) {
+ if (event.y() < other_bookmarked_button_->y() ||
+ event.y() >= other_bookmarked_button_->y() +
+ other_bookmarked_button_->height()) {
// Mouse isn't over a button.
return DragDropTypes::DRAG_NONE;
}
bool found = false;
- const int other_delta_x = mirrored_x - other_bookmarked_button_->GetX();
+ const int other_delta_x = mirrored_x - other_bookmarked_button_->x();
if (other_delta_x >= 0 &&
- other_delta_x < other_bookmarked_button_->GetWidth()) {
+ other_delta_x < other_bookmarked_button_->width()) {
// Mouse is over 'other' folder.
*is_over_other = true;
*drop_on = true;
@@ -1600,8 +1597,8 @@ int BookmarkBarView::CalculateDropOperation(const DropTargetEvent& event,
for (int i = 0; i < GetBookmarkButtonCount() &&
GetBookmarkButton(i)->IsVisible() && !found; i++) {
ChromeViews::TextButton* button = GetBookmarkButton(i);
- int button_x = mirrored_x - button->GetX();
- int button_w = button->GetWidth();
+ int button_x = mirrored_x - button->x();
+ int button_w = button->width();
if (button_x < button_w) {
found = true;
BookmarkNode* node = model_->GetBookmarkBarNode()->GetChild(i);
@@ -1626,9 +1623,9 @@ int BookmarkBarView::CalculateDropOperation(const DropTargetEvent& event,
if (!found) {
if (overflow_button_->IsVisible()) {
// Are we over the overflow button?
- int overflow_delta_x = mirrored_x - overflow_button_->GetX();
+ int overflow_delta_x = mirrored_x - overflow_button_->x();
if (overflow_delta_x >= 0 &&
- overflow_delta_x < overflow_button_->GetWidth()) {
+ overflow_delta_x < overflow_button_->width()) {
// Mouse is over overflow button.
*index = GetFirstHiddenNodeIndex();
*is_over_overflow = true;
@@ -1639,7 +1636,7 @@ int BookmarkBarView::CalculateDropOperation(const DropTargetEvent& event,
} else {
return DragDropTypes::DRAG_NONE;
}
- } else if (mirrored_x < other_bookmarked_button_->GetX()) {
+ } else if (mirrored_x < other_bookmarked_button_->x()) {
// Mouse is after the last visible button but before more recently
// bookmarked; use the last visible index.
*index = GetFirstHiddenNodeIndex();
@@ -1837,4 +1834,3 @@ void BookmarkBarView::StopThrobbing(bool immediate) {
throbbing_view_->StartThrobbing(immediate ? 0 : 4);
throbbing_view_ = NULL;
}
-
diff --git a/chrome/browser/views/bookmark_bar_view_test.cc b/chrome/browser/views/bookmark_bar_view_test.cc
index 211d88d..547f992 100644
--- a/chrome/browser/views/bookmark_bar_view_test.cc
+++ b/chrome/browser/views/bookmark_bar_view_test.cc
@@ -428,7 +428,7 @@ class BookmarkBarViewTest5 : public BookmarkBarViewEventTestBase {
void Step3() {
ChromeViews::MenuItemView* target_menu =
bb_view_->GetMenu()->GetSubmenu()->GetMenuItemAt(1);
- CPoint loc(1, target_menu->GetHeight() - 1);
+ CPoint loc(1, target_menu->height() - 1);
ChromeViews::View::ConvertPointToScreen(target_menu, &loc);
// Start a drag.
@@ -443,7 +443,7 @@ class BookmarkBarViewTest5 : public BookmarkBarViewEventTestBase {
// Drop the item so that it's now the second item.
ChromeViews::MenuItemView* target_menu =
bb_view_->GetMenu()->GetSubmenu()->GetMenuItemAt(1);
- CPoint loc(1, target_menu->GetHeight() - 1);
+ CPoint loc(1, target_menu->height() - 1);
ChromeViews::View::ConvertPointToScreen(target_menu, &loc);
ui_controls::SendMouseMove(loc.x, loc.y);
@@ -537,7 +537,7 @@ class BookmarkBarViewTest7 : public BookmarkBarViewEventTestBase {
// Drag over other button.
ChromeViews::TextButton* other_button =
bb_view_->other_bookmarked_button();
- CPoint loc(other_button->GetWidth() / 2, other_button->GetHeight() / 2);
+ CPoint loc(other_button->width() / 2, other_button->height() / 2);
ChromeViews::View::ConvertPointToScreen(other_button, &loc);
// Start a drag.
@@ -610,7 +610,7 @@ class BookmarkBarViewTest8 : public BookmarkBarViewEventTestBase {
// Drag over other button.
ChromeViews::TextButton* other_button =
bb_view_->other_bookmarked_button();
- CPoint loc(other_button->GetWidth() / 2, other_button->GetHeight() / 2);
+ CPoint loc(other_button->width() / 2, other_button->height() / 2);
ChromeViews::View::ConvertPointToScreen(other_button, &loc);
// Start a drag.
@@ -628,7 +628,7 @@ class BookmarkBarViewTest8 : public BookmarkBarViewEventTestBase {
// Now drag back over first menu.
ChromeViews::TextButton* button = bb_view_->GetBookmarkButton(0);
- CPoint loc(button->GetWidth() / 2, button->GetHeight() / 2);
+ CPoint loc(button->width() / 2, button->height() / 2);
ChromeViews::View::ConvertPointToScreen(button, &loc);
ui_controls::SendMouseMoveNotifyWhenDone(loc.x, loc.y,
NewRunnableMethod(this, &BookmarkBarViewTest8::Step5));
@@ -693,8 +693,8 @@ class BookmarkBarViewTest9 : public BookmarkBarViewEventTestBase {
ASSERT_TRUE(scroll_container != NULL);
ChromeViews::View* scroll_down_button = scroll_container->GetChildViewAt(1);
ASSERT_TRUE(scroll_down_button);
- CPoint loc(scroll_down_button->GetWidth() / 2,
- scroll_down_button->GetHeight() / 2);
+ CPoint loc(scroll_down_button->width() / 2,
+ scroll_down_button->height() / 2);
ChromeViews::View::ConvertPointToScreen(scroll_down_button, &loc);
ui_controls::SendMouseMoveNotifyWhenDone(
loc.x, loc.y, CreateEventTask(this, &BookmarkBarViewTest9::Step3));
diff --git a/chrome/browser/views/clear_browsing_data.cc b/chrome/browser/views/clear_browsing_data.cc
index 06d9b6d..328cf6f 100644
--- a/chrome/browser/views/clear_browsing_data.cc
+++ b/chrome/browser/views/clear_browsing_data.cc
@@ -125,44 +125,44 @@ void ClearBrowsingDataView::Layout() {
// Check-boxes go beneath it (with a little indentation).
del_history_checkbox_->GetPreferredSize(&sz);
del_history_checkbox_->SetBounds(2 * kPanelHorizMargin,
- delete_all_label_->GetY() +
- delete_all_label_->GetHeight() +
+ delete_all_label_->y() +
+ delete_all_label_->height() +
kRelatedControlVerticalSpacing,
sz.cx, sz.cy);
del_downloads_checkbox_->GetPreferredSize(&sz);
del_downloads_checkbox_->SetBounds(2 * kPanelHorizMargin,
- del_history_checkbox_->GetY() +
- del_history_checkbox_->GetHeight() +
+ del_history_checkbox_->y() +
+ del_history_checkbox_->height() +
kRelatedControlVerticalSpacing,
sz.cx, sz.cy);
del_cache_checkbox_->GetPreferredSize(&sz);
del_cache_checkbox_->SetBounds(2 * kPanelHorizMargin,
- del_downloads_checkbox_->GetY() +
- del_downloads_checkbox_->GetHeight() +
+ del_downloads_checkbox_->y() +
+ del_downloads_checkbox_->height() +
kRelatedControlVerticalSpacing,
sz.cx, sz.cy);
del_cookies_checkbox_->GetPreferredSize(&sz);
del_cookies_checkbox_->SetBounds(2 * kPanelHorizMargin,
- del_cache_checkbox_->GetY() +
- del_cache_checkbox_->GetHeight() +
+ del_cache_checkbox_->y() +
+ del_cache_checkbox_->height() +
kRelatedControlVerticalSpacing,
sz.cx, sz.cy);
del_passwords_checkbox_->GetPreferredSize(&sz);
del_passwords_checkbox_->SetBounds(2 * kPanelHorizMargin,
- del_cookies_checkbox_->GetY() +
- del_cookies_checkbox_->GetHeight() +
+ del_cookies_checkbox_->y() +
+ del_cookies_checkbox_->height() +
kRelatedControlVerticalSpacing,
sz.cx, sz.cy);
// Time period label is next below the combo boxes.
time_period_label_->GetPreferredSize(&sz);
time_period_label_->SetBounds(kPanelHorizMargin,
- del_passwords_checkbox_->GetY() +
- del_passwords_checkbox_->GetHeight() +
+ del_passwords_checkbox_->y() +
+ del_passwords_checkbox_->height() +
kRelatedControlVerticalSpacing +
kExtraMarginForTimePeriodLabel,
sz.cx, sz.cy);
@@ -171,10 +171,10 @@ void ClearBrowsingDataView::Layout() {
// vertically to the label as well.
int label_y_size = sz.cy;
time_period_combobox_->GetPreferredSize(&sz);
- time_period_combobox_->SetBounds(time_period_label_->GetX() +
- time_period_label_->GetWidth() +
+ time_period_combobox_->SetBounds(time_period_label_->x() +
+ time_period_label_->width() +
kRelatedControlVerticalSpacing,
- time_period_label_->GetY() -
+ time_period_label_->y() -
((sz.cy - label_y_size) / 2),
sz.cx, sz.cy);
@@ -192,7 +192,7 @@ void ClearBrowsingDataView::Layout() {
// The status label should be at the bottom of the screen, to the right of
// the throbber.
status_label_.GetPreferredSize(&sz);
- int status_label_x = throbber_->GetX() + throbber_->GetWidth() +
+ int status_label_x = throbber_->x() + throbber_->width() +
kRelatedControlHorizontalSpacing;
status_label_.SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT);
status_label_.SetBounds(status_label_x,
diff --git a/chrome/browser/views/constrained_window_impl.cc b/chrome/browser/views/constrained_window_impl.cc
index 4766ea3..7da4086 100644
--- a/chrome/browser/views/constrained_window_impl.cc
+++ b/chrome/browser/views/constrained_window_impl.cc
@@ -583,7 +583,7 @@ void ConstrainedWindowNonClientView::Layout() {
}
close_button_->GetPreferredSize(&ps);
- close_button_->SetBounds(GetWidth() - ps.cx - kWindowControlsRightOffset,
+ close_button_->SetBounds(width() - ps.cx - kWindowControlsRightOffset,
kWindowControlsTopOffset, ps.cx, ps.cy);
int titlebar_height = CalculateTitlebarHeight();
@@ -599,14 +599,14 @@ void ConstrainedWindowNonClientView::Layout() {
if (window_delegate_->ShouldShowWindowTitle()) {
int spacing = kWindowLeftSpacing;
- int title_right = close_button_->GetX() - spacing;
+ int title_right = close_button_->x() - spacing;
int title_left = icon_bounds_.right() + spacing;
title_bounds_.SetRect(title_left, kTitleTopOffset,
title_right - title_left, title_font_.height());
}
}
- client_bounds_ = CalculateClientAreaBounds(GetWidth(), GetHeight());
+ client_bounds_ = CalculateClientAreaBounds(width(), height());
if (should_display_url_field) {
location_bar_->SetBounds(client_bounds_.x() - kLocationBarOffset,
client_bounds_.y() - location_bar_height -
@@ -673,9 +673,6 @@ void ConstrainedWindowNonClientView::UpdateThrobber() {
}
void ConstrainedWindowNonClientView::PaintFrameBorder(ChromeCanvas* canvas) {
- int width = GetWidth();
- int height = GetHeight();
-
SkBitmap* top_left_corner = resources_->GetPartBitmap(FRAME_TOP_LEFT_CORNER);
SkBitmap* top_right_corner =
resources_->GetPartBitmap(FRAME_TOP_RIGHT_CORNER);
@@ -691,33 +688,33 @@ void ConstrainedWindowNonClientView::PaintFrameBorder(ChromeCanvas* canvas) {
// Top.
canvas->DrawBitmapInt(*top_left_corner, 0, 0);
canvas->TileImageInt(*top_edge, top_left_corner->width(), 0,
- width - top_right_corner->width(), top_edge->height());
+ width() - top_right_corner->width(), top_edge->height());
canvas->DrawBitmapInt(
- *top_right_corner, width - top_right_corner->width(), 0);
+ *top_right_corner, width() - top_right_corner->width(), 0);
// Right.
int top_stack_height = top_right_corner->height();
- canvas->TileImageInt(*right_edge, width - right_edge->width(),
+ canvas->TileImageInt(*right_edge, width() - right_edge->width(),
top_stack_height, right_edge->width(),
- height - top_stack_height -
+ height() - top_stack_height -
bottom_right_corner->height());
// Bottom.
canvas->DrawBitmapInt(*bottom_right_corner,
- width - bottom_right_corner->width(),
- height - bottom_right_corner->height());
+ width() - bottom_right_corner->width(),
+ height() - bottom_right_corner->height());
canvas->TileImageInt(*bottom_edge, bottom_left_corner->width(),
- height - bottom_edge->height(),
- width - bottom_left_corner->width() -
+ height() - bottom_edge->height(),
+ width() - bottom_left_corner->width() -
bottom_right_corner->width(),
bottom_edge->height());
canvas->DrawBitmapInt(*bottom_left_corner, 0,
- height - bottom_left_corner->height());
+ height() - bottom_left_corner->height());
// Left.
top_stack_height = top_left_corner->height();
canvas->TileImageInt(*left_edge, 0, top_stack_height, left_edge->width(),
- height - top_stack_height -
+ height() - top_stack_height -
bottom_left_corner->height());
// Contents Border.
@@ -1139,8 +1136,8 @@ void ConstrainedWindowImpl::InitSizeForContents(
contents_container_->Attach(constrained_contents_->GetContainerHWND());
constrained_contents_->SizeContents(
- gfx::Size(contents_container_->GetWidth(),
- contents_container_->GetHeight()));
+ gfx::Size(contents_container_->width(),
+ contents_container_->height()));
current_bounds_ = initial_bounds;
// Note that this is HWND_TOP, not HWND_TOPMOST... this is important
diff --git a/chrome/browser/views/download_item_view.cc b/chrome/browser/views/download_item_view.cc
index 8ed9408..a03b5bc 100644
--- a/chrome/browser/views/download_item_view.cc
+++ b/chrome/browser/views/download_item_view.cc
@@ -229,8 +229,7 @@ void DownloadItemView::OnDownloadUpdated(DownloadItem* download) {
// Load an icon for the file type we're downloading, and animate any in progress
// download state.
void DownloadItemView::Paint(ChromeCanvas* canvas) {
- int height = GetHeight();
- int center_width = GetWidth() - kLeftPadding -
+ int center_width = width() - kLeftPadding -
normal_body_image_set_.left->width() -
normal_body_image_set_.right->width() -
normal_drop_down_image_set_.center->width();
@@ -427,8 +426,8 @@ bool DownloadItemView::OnMousePressed(const ChromeViews::MouseEvent& event) {
complete_animation_->End();
if (event.IsOnlyLeftMouseButton()) {
- WTL::CPoint point(event.GetX(), event.GetY());
- if (event.GetX() < drop_down_x_) {
+ WTL::CPoint point(event.x(), event.y());
+ if (event.x() < drop_down_x_) {
SetState(PUSHED, NORMAL);
return true;
}
@@ -452,9 +451,9 @@ bool DownloadItemView::OnMousePressed(const ChromeViews::MouseEvent& event) {
//
// TODO(idana): when bug# 1163334 is fixed the following check should be
// replaced with UILayoutIsRightToLeft().
- point.y = GetHeight();
+ point.y = height();
if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) {
- point.x = GetWidth();
+ point.x = width();
} else {
point.x = drop_down_x_;
}
@@ -472,7 +471,7 @@ bool DownloadItemView::OnMousePressed(const ChromeViews::MouseEvent& event) {
}
void DownloadItemView::OnMouseMoved(const ChromeViews::MouseEvent& event) {
- bool on_body = event.GetX() < drop_down_x_;
+ bool on_body = event.x() < drop_down_x_;
SetState(on_body ? HOT : NORMAL, on_body ? NORMAL : HOT);
if (on_body) {
body_hover_animation_->Show();
@@ -491,7 +490,7 @@ void DownloadItemView::OnMouseReleased(const ChromeViews::MouseEvent& event,
starting_drag_ = false;
return;
}
- if (event.IsOnlyLeftMouseButton() && event.GetX() < drop_down_x_)
+ if (event.IsOnlyLeftMouseButton() && event.x() < drop_down_x_)
OpenDownload();
SetState(NORMAL, NORMAL);
diff --git a/chrome/browser/views/download_shelf_view.cc b/chrome/browser/views/download_shelf_view.cc
index df6b7d5..4ab60d1 100644
--- a/chrome/browser/views/download_shelf_view.cc
+++ b/chrome/browser/views/download_shelf_view.cc
@@ -156,7 +156,7 @@ void DownloadShelfView::Paint(ChromeCanvas* canvas) {
}
void DownloadShelfView::PaintBorder(ChromeCanvas* canvas) {
- canvas->FillRectInt(kBorderColor, 0, 0, GetWidth(), 1);
+ canvas->FillRectInt(kBorderColor, 0, 0, width(), 1);
}
void DownloadShelfView::GetPreferredSize(CSize *out) {
@@ -203,8 +203,6 @@ void DownloadShelfView::AnimationEnded(const Animation *animation) {
}
void DownloadShelfView::Layout() {
- int width = GetWidth();
- int height = GetHeight();
CSize image_size;
arrow_image_->GetPreferredSize(&image_size);
CSize close_button_size;
@@ -212,21 +210,21 @@ void DownloadShelfView::Layout() {
CSize show_all_size;
show_all_view_->GetPreferredSize(&show_all_size);
int max_download_x =
- std::max<int>(0, width - kRightPadding - close_button_size.cx -
+ std::max<int>(0, width() - kRightPadding - close_button_size.cx -
kCloseAndLinkPadding - show_all_size.cx -
image_size.cx - kDownloadPadding);
int next_x = max_download_x + kDownloadPadding;
// Align vertically with show_all_view_.
- arrow_image_->SetBounds(next_x, CenterPosition(show_all_size.cy, height),
+ arrow_image_->SetBounds(next_x, CenterPosition(show_all_size.cy, height()),
image_size.cx, image_size.cy);
next_x += image_size.cx + kDownloadsTitlePadding;
show_all_view_->SetBounds(next_x,
- CenterPosition(show_all_size.cy, height),
+ CenterPosition(show_all_size.cy, height()),
show_all_size.cx,
show_all_size.cy);
next_x += show_all_size.cx + kCloseAndLinkPadding;
close_button_->SetBounds(next_x,
- CenterPosition(close_button_size.cy, height),
+ CenterPosition(close_button_size.cy, height()),
close_button_size.cx,
close_button_size.cy);
@@ -239,18 +237,18 @@ void DownloadShelfView::Layout() {
int x = next_x;
// Figure out width of item.
- int width = view_size.cx;
+ int item_width = view_size.cx;
if (new_item_animation_->IsAnimating() && ri == download_views_.rbegin()) {
- width = static_cast<int>(static_cast<double>(view_size.cx) *
+ item_width = static_cast<int>(static_cast<double>(view_size.cx) *
new_item_animation_->GetCurrentValue());
}
- next_x += (width + kDownloadPadding);
+ next_x += (item_width + kDownloadPadding);
// Make sure our item can be contained within the shelf.
if (next_x < max_download_x) {
(*ri)->SetVisible(true);
- (*ri)->SetBounds(x, CenterPosition(view_size.cy, height), width,
+ (*ri)->SetBounds(x, CenterPosition(view_size.cy, height()), item_width,
view_size.cy);
} else {
(*ri)->SetVisible(false);
diff --git a/chrome/browser/views/download_tab_view.cc b/chrome/browser/views/download_tab_view.cc
index 8c31275..62e5668 100644
--- a/chrome/browser/views/download_tab_view.cc
+++ b/chrome/browser/views/download_tab_view.cc
@@ -262,7 +262,7 @@ void DownloadItemTabView::LayoutComplete() {
file_name_size.cy + kVerticalPadding +
download_util::kBigProgressIconOffset,
std::min(kFilenameSize,
- static_cast<int>(GetWidth() - dx)),
+ static_cast<int>(width() - dx)),
url_size.cy);
download_url_->SetVisible(true);
dx += kFilenameSize + kSpacer;
@@ -309,7 +309,7 @@ void DownloadItemTabView::LayoutCancelled() {
file_name_size.cy + kVerticalPadding +
download_util::kBigProgressIconOffset,
std::min(kFilenameSize - kProgressSize - kSpacer,
- static_cast<int>(GetWidth() - dx)),
+ static_cast<int>(width() - dx)),
url_size.cy);
download_url_->SetVisible(true);
@@ -395,7 +395,7 @@ void DownloadItemTabView::LayoutInProgress() {
download_url_->SetBounds(dx, file_name_size.cy + kVerticalPadding +
download_util::kBigProgressIconOffset,
std::min(kFilenameSize - kProgressSize - kSpacer,
- static_cast<int>(GetWidth() - dx)),
+ static_cast<int>(width() - dx)),
url_size.cy);
download_url_->SetVisible(true);
@@ -585,7 +585,7 @@ void DownloadItemTabView::DidChangeBounds(const CRect& previous,
}
bool DownloadItemTabView::OnMousePressed(const ChromeViews::MouseEvent& event) {
- CPoint point(event.GetX(), event.GetY());
+ CPoint point(event.x(), event.y());
// If the click is in the highlight region, then highlight this download.
// Otherwise, remove the highlighting from any download.
@@ -623,7 +623,7 @@ bool DownloadItemTabView::OnMouseDragged(const ChromeViews::MouseEvent& event) {
if (model_->state() != DownloadItem::COMPLETE)
return false;
- CPoint point(event.GetX(), event.GetY());
+ CPoint point(event.x(), event.y());
// In order to make sure drag and drop works as expected when the UI is
// mirrored, we can either flip the mouse X coordinate or flip the X position
@@ -723,12 +723,9 @@ void DownloadTabView::Layout() {
View* v = GetParent();
if (v) {
v->GetLocalBounds(&r, true);
- int x = GetX();
- int y = GetY();
- int w = v->GetWidth();
int h = static_cast<int>(downloads_.size()) *
(download_util::kBigProgressIconSize + kSpacer) + kSpacer;
- SetBounds(x, y, w, h);
+ SetBounds(x(), y(), v->width(), h);
}
}
@@ -752,7 +749,7 @@ void DownloadTabView::Paint(ChromeCanvas* canvas) {
continue;
download_rect.set(SkIntToScalar(0),
SkIntToScalar(y),
- SkIntToScalar(GetWidth()),
+ SkIntToScalar(width()),
SkIntToScalar(y + download_util::kBigProgressIconSize));
if (SkRect::Intersects(clip, download_rect)) {
// The DownloadManager stores downloads earliest first, but this
@@ -761,7 +758,7 @@ void DownloadTabView::Paint(ChromeCanvas* canvas) {
download_renderer_.SetModel(downloads_[index], this);
PaintFloatingView(canvas, &download_renderer_,
0, y,
- GetWidth(), download_util::kBigProgressIconSize);
+ width(), download_util::kBigProgressIconSize);
}
}
}
@@ -796,7 +793,7 @@ ChromeViews::View* DownloadTabView::CreateFloatingViewForIndex(int index) {
dl->SetModel(downloads_[index], this);
int row = static_cast<int>(downloads_.size()) - 1 - index;
int y_pos = row * (download_util::kBigProgressIconSize + kSpacer) + kSpacer;
- dl->SetBounds(0, y_pos, GetWidth(), download_util::kBigProgressIconSize);
+ dl->SetBounds(0, y_pos, width(), download_util::kBigProgressIconSize);
dl->Layout();
AttachFloatingView(dl, index);
return dl;
@@ -1023,7 +1020,7 @@ bool DownloadTabView::ItemIsSelected(DownloadItem* download) {
void DownloadTabView::SchedulePaintForViewAtIndex(int index) {
int y = GetYPositionForIndex(index);
- SchedulePaint(0, y, GetWidth(), download_util::kBigProgressIconSize);
+ SchedulePaint(0, y, width(), download_util::kBigProgressIconSize);
}
int DownloadTabView::GetYPositionForIndex(int index) {
diff --git a/chrome/browser/views/first_run_bubble.cc b/chrome/browser/views/first_run_bubble.cc
index 6696e55..2dfc8ef 100644
--- a/chrome/browser/views/first_run_bubble.cc
+++ b/chrome/browser/views/first_run_bubble.cc
@@ -126,7 +126,7 @@ class FirstRunBubbleView : public ChromeViews::View,
canvas.cx - kBubblePadding * 2,
pref_size.cy);
- int next_v_space = label1_->GetY() + pref_size.cy +
+ int next_v_space = label1_->y() + pref_size.cy +
kRelatedControlSmallVerticalSpacing;
label2_->GetPreferredSize(&pref_size);
@@ -134,7 +134,7 @@ class FirstRunBubbleView : public ChromeViews::View,
canvas.cx - kBubblePadding * 2,
pref_size.cy);
- next_v_space = label2_->GetY() + label2_->GetHeight() +
+ next_v_space = label2_->y() + label2_->height() +
kPanelSubVerticalSpacing;
label3_->GetPreferredSize(&pref_size);
@@ -148,8 +148,8 @@ class FirstRunBubbleView : public ChromeViews::View,
pref_size.cx, pref_size.cy);
keep_button_->GetPreferredSize(&pref_size);
- keep_button_->SetBounds(change_button_->GetX() - pref_size.cx -
- kRelatedButtonHSpacing, change_button_->GetY(),
+ keep_button_->SetBounds(change_button_->x() - pref_size.cx -
+ kRelatedButtonHSpacing, change_button_->y(),
pref_size.cx, pref_size.cy);
}
diff --git a/chrome/browser/views/first_run_customize_view.cc b/chrome/browser/views/first_run_customize_view.cc
index 1109ac9..378a135 100644
--- a/chrome/browser/views/first_run_customize_view.cc
+++ b/chrome/browser/views/first_run_customize_view.cc
@@ -104,8 +104,8 @@ void FirstRunCustomizeView::Layout() {
canvas.cx - pref_size.cx, pref_size.cy);
AdjustDialogWidth(main_label_);
- int next_v_space = background_image()->GetY() +
- background_image()->GetHeight() + kPanelVertMargin;
+ int next_v_space = background_image()->y() +
+ background_image()->height() + kPanelVertMargin;
import_cbox_->GetPreferredSize(&pref_size);
import_cbox_->SetBounds(kPanelHorizMargin, next_v_space,
@@ -113,8 +113,8 @@ void FirstRunCustomizeView::Layout() {
import_cbox_->SetIsSelected(true);
- int x_offset = import_cbox_->GetX() +
- import_cbox_->GetWidth();
+ int x_offset = import_cbox_->x() +
+ import_cbox_->width();
import_from_combo_->GetPreferredSize(&pref_size);
import_from_combo_->SetBounds(x_offset, next_v_space,
@@ -122,7 +122,7 @@ void FirstRunCustomizeView::Layout() {
AdjustDialogWidth(import_from_combo_);
- next_v_space = import_cbox_->GetY() + import_cbox_->GetHeight() +
+ next_v_space = import_cbox_->y() + import_cbox_->height() +
kUnrelatedControlVerticalSpacing;
default_browser_cbox_->GetPreferredSize(&pref_size);
@@ -131,7 +131,7 @@ void FirstRunCustomizeView::Layout() {
AdjustDialogWidth(default_browser_cbox_);
- next_v_space += default_browser_cbox_->GetHeight() +
+ next_v_space += default_browser_cbox_->height() +
kUnrelatedControlVerticalSpacing;
shortcuts_label_->GetPreferredSize(&pref_size);
@@ -140,7 +140,7 @@ void FirstRunCustomizeView::Layout() {
AdjustDialogWidth(shortcuts_label_);
- next_v_space += shortcuts_label_->GetHeight() +
+ next_v_space += shortcuts_label_->height() +
kRelatedControlVerticalSpacing;
desktop_shortcut_cbox_->GetPreferredSize(&pref_size);
@@ -149,7 +149,7 @@ void FirstRunCustomizeView::Layout() {
AdjustDialogWidth(desktop_shortcut_cbox_);
- next_v_space += desktop_shortcut_cbox_->GetHeight() +
+ next_v_space += desktop_shortcut_cbox_->height() +
kRelatedControlVerticalSpacing;
quick_shortcut_cbox_->GetPreferredSize(&pref_size);
diff --git a/chrome/browser/views/first_run_view.cc b/chrome/browser/views/first_run_view.cc
index 9e581e3..1796b56 100644
--- a/chrome/browser/views/first_run_view.cc
+++ b/chrome/browser/views/first_run_view.cc
@@ -107,30 +107,30 @@ void FirstRunView::Layout() {
CSize pref_size;
welcome_label_->GetPreferredSize(&pref_size);
// Wrap the label text before we overlap the product icon.
- int label_width = background_image()->GetWidth() -
+ int label_width = background_image()->width() -
rb.GetBitmapNamed(IDR_WIZARD_ICON)->width() - kPanelHorizMargin;
welcome_label_->SetBounds(kPanelHorizMargin, kPanelVertMargin,
label_width, pref_size.cy);
AdjustDialogWidth(welcome_label_);
- int next_v_space = background_image()->GetY() +
- background_image()->GetHeight() + kPanelVertMargin;
+ int next_v_space = background_image()->y() +
+ background_image()->height() + kPanelVertMargin;
actions_label_->GetPreferredSize(&pref_size);
actions_label_->SetBounds(kPanelHorizMargin, next_v_space,
pref_size.cx, pref_size.cy);
AdjustDialogWidth(actions_label_);
- next_v_space = actions_label_->GetY() +
- actions_label_->GetHeight() + kVertSpacing;
+ next_v_space = actions_label_->y() +
+ actions_label_->height() + kVertSpacing;
- label_width = GetWidth() - (2 * kPanelHorizMargin);
+ label_width = width() - (2 * kPanelHorizMargin);
int label_height = actions_import_->GetHeightForWidth(label_width);
actions_import_->SetBounds(kPanelHorizMargin, next_v_space, label_width,
label_height);
- next_v_space = actions_import_->GetY() +
- actions_import_->GetHeight() + kVertSpacing;
+ next_v_space = actions_import_->y() +
+ actions_import_->height() + kVertSpacing;
AdjustDialogWidth(actions_import_);
label_height = actions_shorcuts_->GetHeightForWidth(label_width);
@@ -138,8 +138,8 @@ void FirstRunView::Layout() {
label_height);
AdjustDialogWidth(actions_shorcuts_);
- next_v_space = actions_shorcuts_->GetY() +
- actions_shorcuts_->GetHeight() +
+ next_v_space = actions_shorcuts_->y() +
+ actions_shorcuts_->height() +
kUnrelatedControlVerticalSpacing;
customize_link_->GetPreferredSize(&pref_size);
diff --git a/chrome/browser/views/first_run_view_base.cc b/chrome/browser/views/first_run_view_base.cc
index e6aa69d..df1268b 100644
--- a/chrome/browser/views/first_run_view_base.cc
+++ b/chrome/browser/views/first_run_view_base.cc
@@ -118,8 +118,8 @@ void FirstRunViewBase::Layout() {
background_image_->GetPreferredSize(&pref_size);
background_image_->SetBounds(0, 0, canvas.cx, pref_size.cy);
- int next_v_space = background_image_->GetY() +
- background_image_->GetHeight() - 2;
+ int next_v_space = background_image_->y() +
+ background_image_->height() - 2;
separator_1_->GetPreferredSize(&pref_size);
separator_1_->SetBounds(0 , next_v_space, canvas.cx + 1, pref_size.cy);
diff --git a/chrome/browser/views/frame/aero_glass_frame.cc b/chrome/browser/views/frame/aero_glass_frame.cc
index 2d7d4bf..f951b3d 100644
--- a/chrome/browser/views/frame/aero_glass_frame.cc
+++ b/chrome/browser/views/frame/aero_glass_frame.cc
@@ -207,7 +207,7 @@ void AeroGlassFrame::UpdateDWMFrame() {
gfx::Rect tabstrip_bounds =
GetBoundsForTabStrip(browser_view_->tabstrip());
client_edge_top_height =
- client_view()->GetY() + tabstrip_bounds.bottom();
+ client_view()->y() + tabstrip_bounds.bottom();
}
// Now poke the DWM.
diff --git a/chrome/browser/views/frame/aero_glass_non_client_view.cc b/chrome/browser/views/frame/aero_glass_non_client_view.cc
index 5a359b4..16bafa3 100644
--- a/chrome/browser/views/frame/aero_glass_non_client_view.cc
+++ b/chrome/browser/views/frame/aero_glass_non_client_view.cc
@@ -127,7 +127,7 @@ AeroGlassNonClientView::~AeroGlassNonClientView() {
gfx::Rect AeroGlassNonClientView::GetBoundsForTabStrip(TabStrip* tabstrip) {
// If we are maximized, the tab strip will be in line with the window
// controls, so we need to make sure they don't overlap.
- int tabstrip_width = browser_view_->GetWidth();
+ int tabstrip_width = browser_view_->width();
if(frame_->IsMaximized()) {
TITLEBARINFOEX titlebar_info;
titlebar_info.cbSize = sizeof(TITLEBARINFOEX);
@@ -145,17 +145,17 @@ gfx::Rect AeroGlassNonClientView::GetBoundsForTabStrip(TabStrip* tabstrip) {
///////////////////////////////////////////////////////////////////////////////
// AeroGlassNonClientView, ChromeViews::NonClientView implementation:
-gfx::Rect AeroGlassNonClientView::CalculateClientAreaBounds(int width,
- int height) const {
+gfx::Rect AeroGlassNonClientView::CalculateClientAreaBounds(int win_width,
+ int win_height) const {
if (!browser_view_->IsToolbarVisible()) {
// App windows don't have a toolbar.
- return gfx::Rect(0, 0, GetWidth(), GetHeight());
+ return gfx::Rect(0, 0, width(), height());
}
int top_margin = CalculateNonClientTopHeight();
return gfx::Rect(kWindowHorizontalClientEdgeWidth, top_margin,
- std::max(0, width - (2 * kWindowHorizontalClientEdgeWidth)),
- std::max(0, height - top_margin - kWindowBottomClientEdgeHeight));
+ std::max(0, win_width - (2 * kWindowHorizontalClientEdgeWidth)),
+ std::max(0, win_height - top_margin - kWindowBottomClientEdgeHeight));
}
gfx::Size AeroGlassNonClientView::CalculateWindowSizeForClientSize(
@@ -190,8 +190,8 @@ int AeroGlassNonClientView::NonClientHitTest(const gfx::Point& point) {
// high, we need to make sure the right hit-test codes are returned for the
// caption area above the tabs and the top sizing border.
int client_view_right =
- frame_->client_view()->GetX() + frame_->client_view()->GetWidth();
- if (point.x() >= frame_->client_view()->GetX() &&
+ frame_->client_view()->x() + frame_->client_view()->width();
+ if (point.x() >= frame_->client_view()->x() &&
point.x() < client_view_right) {
if (point.y() < kWindowSizingBorderSize)
return HTTOP;
@@ -328,9 +328,9 @@ void AeroGlassNonClientView::PaintClientEdge(ChromeCanvas* canvas) {
// the left and right sides of the toolbar background.
client_area_bounds.SetRect(
client_area_bounds.x(),
- frame_->client_view()->GetY() + toolbar_bounds.bottom() - kPixel,
+ frame_->client_view()->y() + toolbar_bounds.bottom() - kPixel,
client_area_bounds.width(),
- std::max(0, GetHeight() - frame_->client_view()->GetY() -
+ std::max(0, height() - frame_->client_view()->y() -
toolbar_bounds.bottom() + kPixel));
int fudge = frame_->window_delegate()->ShouldShowWindowTitle() ? kPixel : 0;
@@ -362,17 +362,17 @@ void AeroGlassNonClientView::LayoutDistributorLogo() {
int logo_w = distributor_logo_.width();
int logo_h = distributor_logo_.height();
- int w = GetWidth();
+ int w = width();
int mbx = frame_->GetMinimizeButtonOffset();
logo_bounds_.SetRect(
- GetWidth() - frame_->GetMinimizeButtonOffset() - logo_w,
+ width() - frame_->GetMinimizeButtonOffset() - logo_w,
kDistributorLogoVerticalOffset, logo_w, logo_h);
}
void AeroGlassNonClientView::LayoutClientView() {
gfx::Rect client_bounds(
- CalculateClientAreaBounds(GetWidth(), GetHeight()));
+ CalculateClientAreaBounds(width(), height()));
frame_->client_view()->SetBounds(client_bounds.ToRECT());
}
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc
index 514f17d..5bff85a 100644
--- a/chrome/browser/views/frame/browser_view.cc
+++ b/chrome/browser/views/frame/browser_view.cc
@@ -45,7 +45,7 @@ void BrowserView::LayoutStatusBubble(int status_bubble_y) {
status_bubble_->SetBounds(kStatusBubbleOffset,
status_bubble_y - kStatusBubbleHeight +
kStatusBubbleOffset,
- GetWidth() / 3,
+ width() / 3,
kStatusBubbleHeight);
}
@@ -219,7 +219,7 @@ int BrowserView::NonClientHitTest(const gfx::Point& point) {
// BrowserView, ChromeViews::View overrides:
void BrowserView::Layout() {
- toolbar_->SetBounds(0, 0, GetWidth(), GetHeight());
+ toolbar_->SetBounds(0, 0, width(), height());
}
void BrowserView::DidChangeBounds(const CRect& previous,
diff --git a/chrome/browser/views/frame/browser_view2.cc b/chrome/browser/views/frame/browser_view2.cc
index 1ce9174..b609d1c 100644
--- a/chrome/browser/views/frame/browser_view2.cc
+++ b/chrome/browser/views/frame/browser_view2.cc
@@ -126,7 +126,7 @@ gfx::Rect BrowserView2::GetToolbarBounds() const {
gfx::Rect BrowserView2::GetClientAreaBounds() const {
CRect bounds;
contents_container_->GetBounds(&bounds);
- bounds.OffsetRect(GetX(), GetY());
+ bounds.OffsetRect(x(), y());
return gfx::Rect(bounds);
}
@@ -727,7 +727,7 @@ int BrowserView2::NonClientHitTest(const gfx::Point& point) {
// starved of dragable area, let's give it to window dragging (this also
// makes sense visually).
if (!window->IsMaximized() &&
- (point_in_view_coords.y < tabstrip_->GetY() + kTabShadowSize)) {
+ (point_in_view_coords.y < tabstrip_->y() + kTabShadowSize)) {
// We return HTNOWHERE as this is a signal to our containing
// NonClientView that it should figure out what the correct hit-test
// code is given the mouse position...
@@ -740,7 +740,7 @@ int BrowserView2::NonClientHitTest(const gfx::Point& point) {
// client area.
CRect bounds;
GetBounds(&bounds);
- bounds.top += toolbar_->GetY();
+ bounds.top += toolbar_->y();
if (gfx::Rect(bounds).Contains(point.x(), point.y()))
return HTCLIENT;
@@ -749,7 +749,7 @@ int BrowserView2::NonClientHitTest(const gfx::Point& point) {
// in the window caption (e.g. the area to the right of the tabstrip
// underneath the window controls).
GetBounds(&bounds);
- bounds.bottom = GetY() + toolbar_->GetY();
+ bounds.bottom = y() + toolbar_->y();
if (gfx::Rect(bounds).Contains(point.x(), point.y()))
return HTCAPTION;
@@ -853,19 +853,19 @@ bool BrowserView2::ShouldForwardToTabStrip(
if (!tabstrip_->IsVisible())
return false;
- const int tab_y = tabstrip_->GetY();
- const int tab_height = tabstrip_->GetHeight();
- if (event.GetY() >= tab_y + tab_height)
+ const int tab_y = tabstrip_->y();
+ const int tab_height = tabstrip_->height();
+ if (event.y() >= tab_y + tab_height)
return false;
- if (event.GetY() >= tab_y)
+ if (event.y() >= tab_y)
return true;
// Mouse isn't over the tab strip. Only forward if the mouse isn't over
// another view on the tab strip or is over a view we were told the user can
// drop on.
ChromeViews::View* view_over_mouse =
- GetViewForPoint(CPoint(event.GetX(), event.GetY()));
+ GetViewForPoint(CPoint(event.x(), event.y()));
return (view_over_mouse == this || view_over_mouse == tabstrip_ ||
dropable_views_.find(view_over_mouse) != dropable_views_.end());
}
@@ -899,7 +899,7 @@ int BrowserView2::LayoutToolbar(int top) {
// by a pixel to make things look good.
if (!IsTabStripVisible() && win_util::ShouldUseVistaFrame())
ps.cy -= 1;
- int browser_view_width = GetWidth();
+ int browser_view_width = width();
#ifdef CHROME_PERSONALIZATION
if (IsPersonalizationEnabled())
Personalization::AdjustBrowserView(personalization_, &browser_view_width);
@@ -935,7 +935,7 @@ int BrowserView2::LayoutBookmarkBar(int top) {
active_bookmark_bar_->GetPreferredSize(&ps);
if (!active_info_bar_ || show_bookmark_bar_pref_.GetValue())
top -= kSeparationLineHeight;
- active_bookmark_bar_->SetBounds(0, top, GetWidth(), ps.cy);
+ active_bookmark_bar_->SetBounds(0, top, width(), ps.cy);
top += ps.cy;
}
return top;
@@ -944,7 +944,7 @@ int BrowserView2::LayoutInfoBar(int top) {
if (SupportsWindowFeature(FEATURE_INFOBAR) && active_info_bar_) {
CSize ps;
active_info_bar_->GetPreferredSize(&ps);
- active_info_bar_->SetBounds(0, top, GetWidth(), ps.cy);
+ active_info_bar_->SetBounds(0, top, width(), ps.cy);
top += ps.cy;
if (SupportsWindowFeature(FEATURE_BOOKMARKBAR) && active_bookmark_bar_ &&
!show_bookmark_bar_pref_.GetValue()) {
@@ -955,15 +955,15 @@ int BrowserView2::LayoutInfoBar(int top) {
}
void BrowserView2::LayoutTabContents(int top, int bottom) {
- contents_container_->SetBounds(0, top, GetWidth(), bottom - top);
+ contents_container_->SetBounds(0, top, width(), bottom - top);
}
int BrowserView2::LayoutDownloadShelf() {
- int bottom = GetHeight();
+ int bottom = height();
if (SupportsWindowFeature(FEATURE_DOWNLOADSHELF) && active_download_shelf_) {
CSize ps;
active_download_shelf_->GetPreferredSize(&ps);
- active_download_shelf_->SetBounds(0, bottom - ps.cy, GetWidth(), ps.cy);
+ active_download_shelf_->SetBounds(0, bottom - ps.cy, width(), ps.cy);
bottom -= ps.cy;
}
return bottom;
@@ -971,9 +971,9 @@ int BrowserView2::LayoutDownloadShelf() {
void BrowserView2::LayoutStatusBubble(int top) {
int status_bubble_y =
- top - kStatusBubbleHeight + kStatusBubbleOffset + GetY();
+ top - kStatusBubbleHeight + kStatusBubbleOffset + y();
status_bubble_->SetBounds(kStatusBubbleOffset, status_bubble_y,
- GetWidth() / 3, kStatusBubbleHeight);
+ width() / 3, kStatusBubbleHeight);
}
bool BrowserView2::MaybeShowBookmarkBar(TabContents* contents) {
@@ -1019,7 +1019,7 @@ bool BrowserView2::UpdateChildViewAndLayout(ChromeViews::View* new_view,
if (new_view) {
CSize pref_size;
new_view->GetPreferredSize(&pref_size);
- if (pref_size.cy != new_view->GetHeight())
+ if (pref_size.cy != new_view->height())
return true;
}
return false;
@@ -1032,7 +1032,7 @@ bool BrowserView2::UpdateChildViewAndLayout(ChromeViews::View* new_view,
int current_height = 0;
if (*old_view) {
- current_height = (*old_view)->GetHeight();
+ current_height = (*old_view)->height();
RemoveChildView(*old_view);
}
diff --git a/chrome/browser/views/frame/browser_window_factory.cc b/chrome/browser/views/frame/browser_window_factory.cc
index 9968e58..1586e48 100644
--- a/chrome/browser/views/frame/browser_window_factory.cc
+++ b/chrome/browser/views/frame/browser_window_factory.cc
@@ -1,67 +1,67 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/command_line.h"
-#include "chrome/browser/browser.h"
-#include "chrome/browser/browser_process.h" // TODO(beng): remove once done.
-#include "chrome/browser/browser_window.h"
-#include "chrome/browser/frame_util.h"
-#include "chrome/browser/views/frame/aero_glass_frame.h"
-#include "chrome/browser/views/frame/browser_frame.h"
-#include "chrome/browser/views/frame/browser_view.h"
-#include "chrome/browser/views/frame/browser_view2.h"
-#include "chrome/browser/views/frame/opaque_frame.h"
-#include "chrome/common/win_util.h"
-
-///////////////////////////////////////////////////////////////////////////////
-// BrowserWindow, public:
-
-// static
-BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser,
- const gfx::Rect& bounds,
- int show_command) {
- // TODO(beng): fix this hack.
- // To get us off the ground and allow us to incrementally migrate
- // BrowserWindow functionality from XP/VistaFrame to BrowserView,
- // all objects need to implement the BrowserWindow interface.
- // However BrowserView is the one that Browser has a ref to, and
- // calls that BrowserView can't perform directly are passed on to
- // its frame. Eventually this will be better, I promise.
- if (g_browser_process->IsUsingNewFrames()) {
- BrowserView2* browser_view = new BrowserView2(browser);
- BrowserFrame::CreateForBrowserView(BrowserFrame::GetActiveFrameType(),
- browser_view, bounds, show_command);
- return browser_view;
- }
- BrowserWindow* window = FrameUtil::CreateBrowserWindow(bounds, browser);
- return window->GetBrowserView();
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// BrowserFrame, public:
-
-// static
-BrowserFrame::FrameType BrowserFrame::GetActiveFrameType() {
- return win_util::ShouldUseVistaFrame() ? BrowserFrame::FRAMETYPE_AERO_GLASS
- : BrowserFrame::FRAMETYPE_OPAQUE;
-}
-
-// static
-BrowserFrame* BrowserFrame::CreateForBrowserView(BrowserFrame::FrameType type,
- BrowserView2* browser_view,
- const gfx::Rect& bounds,
- int show_command) {
- if (type == FRAMETYPE_OPAQUE) {
- OpaqueFrame* frame = new OpaqueFrame(browser_view);
- frame->Init(NULL, bounds);
- return frame;
- } else if (type == FRAMETYPE_AERO_GLASS) {
- AeroGlassFrame* frame = new AeroGlassFrame(browser_view);
- frame->Init(bounds);
- return frame;
- }
- NOTREACHED() << "Unsupported frame type";
- return NULL;
-}
-
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/command_line.h"
+#include "chrome/browser/browser.h"
+#include "chrome/browser/browser_process.h" // TODO(beng): remove once done.
+#include "chrome/browser/browser_window.h"
+#include "chrome/browser/frame_util.h"
+#include "chrome/browser/views/frame/aero_glass_frame.h"
+#include "chrome/browser/views/frame/browser_frame.h"
+#include "chrome/browser/views/frame/browser_view.h"
+#include "chrome/browser/views/frame/browser_view2.h"
+#include "chrome/browser/views/frame/opaque_frame.h"
+#include "chrome/common/win_util.h"
+
+///////////////////////////////////////////////////////////////////////////////
+// BrowserWindow, public:
+
+// static
+BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser,
+ const gfx::Rect& bounds,
+ int show_command) {
+ // TODO(beng): fix this hack.
+ // To get us off the ground and allow us to incrementally migrate
+ // BrowserWindow functionality from XP/VistaFrame to BrowserView,
+ // all objects need to implement the BrowserWindow interface.
+ // However BrowserView is the one that Browser has a ref to, and
+ // calls that BrowserView can't perform directly are passed on to
+ // its frame. Eventually this will be better, I promise.
+ if (g_browser_process->IsUsingNewFrames()) {
+ BrowserView2* browser_view = new BrowserView2(browser);
+ BrowserFrame::CreateForBrowserView(BrowserFrame::GetActiveFrameType(),
+ browser_view, bounds, show_command);
+ return browser_view;
+ }
+ BrowserWindow* window = FrameUtil::CreateBrowserWindow(bounds, browser);
+ return window->GetBrowserView();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// BrowserFrame, public:
+
+// static
+BrowserFrame::FrameType BrowserFrame::GetActiveFrameType() {
+ return win_util::ShouldUseVistaFrame() ? BrowserFrame::FRAMETYPE_AERO_GLASS
+ : BrowserFrame::FRAMETYPE_OPAQUE;
+}
+
+// static
+BrowserFrame* BrowserFrame::CreateForBrowserView(BrowserFrame::FrameType type,
+ BrowserView2* browser_view,
+ const gfx::Rect& bounds,
+ int show_command) {
+ if (type == FRAMETYPE_OPAQUE) {
+ OpaqueFrame* frame = new OpaqueFrame(browser_view);
+ frame->Init(NULL, bounds);
+ return frame;
+ } else if (type == FRAMETYPE_AERO_GLASS) {
+ AeroGlassFrame* frame = new AeroGlassFrame(browser_view);
+ frame->Init(bounds);
+ return frame;
+ }
+ NOTREACHED() << "Unsupported frame type";
+ return NULL;
+}
+
diff --git a/chrome/browser/views/frame/opaque_non_client_view.cc b/chrome/browser/views/frame/opaque_non_client_view.cc
index 6febf81..b85186b 100644
--- a/chrome/browser/views/frame/opaque_non_client_view.cc
+++ b/chrome/browser/views/frame/opaque_non_client_view.cc
@@ -457,7 +457,7 @@ gfx::Rect OpaqueNonClientView::GetWindowBoundsForClientBounds(
gfx::Rect OpaqueNonClientView::GetBoundsForTabStrip(TabStrip* tabstrip) {
int tabstrip_height = tabstrip->GetPreferredHeight();
int tabstrip_x = otr_avatar_bounds_.right();
- return gfx::Rect(tabstrip_x, 0, minimize_button_->GetX() - tabstrip_x,
+ return gfx::Rect(tabstrip_x, 0, minimize_button_->x() - tabstrip_x,
tabstrip_height);
}
@@ -701,9 +701,6 @@ int OpaqueNonClientView::CalculateNonClientTopHeight() const {
}
void OpaqueNonClientView::PaintFrameBorder(ChromeCanvas* canvas) {
- int width = GetWidth();
- int height = GetHeight();
-
SkBitmap* top_left_corner =
resources()->GetPartBitmap(FRAME_TOP_LEFT_CORNER);
SkBitmap* top_right_corner =
@@ -720,33 +717,33 @@ void OpaqueNonClientView::PaintFrameBorder(ChromeCanvas* canvas) {
// Top.
canvas->DrawBitmapInt(*top_left_corner, 0, 0);
canvas->TileImageInt(*top_edge, top_left_corner->width(), 0,
- width - top_right_corner->width(), top_edge->height());
+ width() - top_right_corner->width(), top_edge->height());
canvas->DrawBitmapInt(*top_right_corner,
- width - top_right_corner->width(), 0);
+ width() - top_right_corner->width(), 0);
// Right.
int top_stack_height = top_right_corner->height();
- canvas->TileImageInt(*right_edge, width - right_edge->width(),
+ canvas->TileImageInt(*right_edge, width() - right_edge->width(),
top_stack_height, right_edge->width(),
- height - top_stack_height -
+ height() - top_stack_height -
bottom_right_corner->height());
// Bottom.
canvas->DrawBitmapInt(*bottom_right_corner,
- width - bottom_right_corner->width(),
- height - bottom_right_corner->height());
+ width() - bottom_right_corner->width(),
+ height() - bottom_right_corner->height());
canvas->TileImageInt(*bottom_edge, bottom_left_corner->width(),
- height - bottom_edge->height(),
- width - bottom_left_corner->width() -
+ height() - bottom_edge->height(),
+ width() - bottom_left_corner->width() -
bottom_right_corner->width(),
bottom_edge->height());
canvas->DrawBitmapInt(*bottom_left_corner, 0,
- height - bottom_left_corner->height());
+ height() - bottom_left_corner->height());
// Left.
top_stack_height = top_left_corner->height();
canvas->TileImageInt(*left_edge, 0, top_stack_height, left_edge->width(),
- height - top_stack_height -
+ height() - top_stack_height -
bottom_left_corner->height());
}
@@ -754,9 +751,9 @@ void OpaqueNonClientView::PaintMaximizedFrameBorder(ChromeCanvas* canvas) {
SkBitmap* top_edge = resources()->GetPartBitmap(FRAME_MAXIMIZED_TOP_EDGE);
SkBitmap* bottom_edge =
resources()->GetPartBitmap(FRAME_MAXIMIZED_BOTTOM_EDGE);
- canvas->TileImageInt(*top_edge, 0, 0, GetWidth(), top_edge->height());
- canvas->TileImageInt(*bottom_edge, 0, GetHeight() - bottom_edge->height(),
- GetWidth(), bottom_edge->height());
+ canvas->TileImageInt(*top_edge, 0, 0, width(), top_edge->height());
+ canvas->TileImageInt(*bottom_edge, 0, height() - bottom_edge->height(),
+ width(), bottom_edge->height());
}
void OpaqueNonClientView::PaintOTRAvatar(ChromeCanvas* canvas) {
@@ -835,9 +832,9 @@ void OpaqueNonClientView::PaintClientEdge(ChromeCanvas* canvas) {
int fudge = frame_->window_delegate()->ShouldShowWindowTitle() ? 0 : 1;
client_area_bounds.SetRect(
client_area_bounds.x(),
- frame_->client_view()->GetY() + toolbar_bounds.bottom() - fudge,
+ frame_->client_view()->y() + toolbar_bounds.bottom() - fudge,
client_area_bounds.width(),
- std::max(0, GetHeight() - frame_->client_view()->GetY() -
+ std::max(0, height() - frame_->client_view()->y() -
toolbar_bounds.bottom() + fudge - kWindowVerticalBorderBottomSize));
// Now the fudge inverts for app vs browser windows.
@@ -883,46 +880,46 @@ void OpaqueNonClientView::LayoutWindowControls() {
close_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT,
ChromeViews::Button::ALIGN_BOTTOM);
close_button_->SetBounds(
- GetWidth() - ps.cx - kWindowControlsRightZoomedOffset,
+ width() - ps.cx - kWindowControlsRightZoomedOffset,
0, ps.cx + kWindowControlsRightZoomedOffset,
ps.cy + kWindowControlsTopZoomedOffset);
restore_button_->GetPreferredSize(&ps);
restore_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT,
ChromeViews::Button::ALIGN_BOTTOM);
- restore_button_->SetBounds(close_button_->GetX() - ps.cx, 0, ps.cx,
+ restore_button_->SetBounds(close_button_->x() - ps.cx, 0, ps.cx,
ps.cy + kWindowControlsTopZoomedOffset);
minimize_button_->GetPreferredSize(&ps);
minimize_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT,
ChromeViews::Button::ALIGN_BOTTOM);
- minimize_button_->SetBounds(restore_button_->GetX() - ps.cx, 0, ps.cx,
+ minimize_button_->SetBounds(restore_button_->x() - ps.cx, 0, ps.cx,
ps.cy + kWindowControlsTopZoomedOffset);
} else if (frame_->IsMinimized()) {
close_button_->GetPreferredSize(&ps);
close_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT,
ChromeViews::Button::ALIGN_BOTTOM);
close_button_->SetBounds(
- GetWidth() - ps.cx - kWindowControlsRightZoomedOffset,
+ width() - ps.cx - kWindowControlsRightZoomedOffset,
0, ps.cx + kWindowControlsRightZoomedOffset,
ps.cy + kWindowControlsTopZoomedOffset);
restore_button_->GetPreferredSize(&ps);
restore_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT,
ChromeViews::Button::ALIGN_BOTTOM);
- restore_button_->SetBounds(close_button_->GetX() - ps.cx, 0, ps.cx,
+ restore_button_->SetBounds(close_button_->x() - ps.cx, 0, ps.cx,
ps.cy + kWindowControlsTopZoomedOffset);
minimize_button_->GetPreferredSize(&ps);
minimize_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT,
ChromeViews::Button::ALIGN_BOTTOM);
- minimize_button_->SetBounds(restore_button_->GetX() - ps.cx, 0, ps.cx,
+ minimize_button_->SetBounds(restore_button_->x() - ps.cx, 0, ps.cx,
ps.cy + kWindowControlsTopZoomedOffset);
} else {
close_button_->GetPreferredSize(&ps);
close_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT,
ChromeViews::Button::ALIGN_TOP);
- close_button_->SetBounds(GetWidth() - kWindowControlsRightOffset - ps.cx,
+ close_button_->SetBounds(width() - kWindowControlsRightOffset - ps.cx,
kWindowControlsTopOffset, ps.cx, ps.cy);
restore_button_->SetVisible(false);
@@ -931,13 +928,13 @@ void OpaqueNonClientView::LayoutWindowControls() {
maximize_button_->GetPreferredSize(&ps);
maximize_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT,
ChromeViews::Button::ALIGN_TOP);
- maximize_button_->SetBounds(close_button_->GetX() - ps.cx,
+ maximize_button_->SetBounds(close_button_->x() - ps.cx,
kWindowControlsTopOffset, ps.cx, ps.cy);
minimize_button_->GetPreferredSize(&ps);
minimize_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT,
ChromeViews::Button::ALIGN_TOP);
- minimize_button_->SetBounds(maximize_button_->GetX() - ps.cx,
+ minimize_button_->SetBounds(maximize_button_->x() - ps.cx,
kWindowControlsTopOffset, ps.cx, ps.cy);
}
}
@@ -973,7 +970,7 @@ void OpaqueNonClientView::LayoutDistributorLogo() {
APPLY_MIRRORING_TRANSFORMATION);
logo_x = minimize_bounds.right + kDistributorLogoHorizontalOffset;
} else {
- logo_x = minimize_button_->GetX() - logo_w -
+ logo_x = minimize_button_->x() - logo_w -
kDistributorLogoHorizontalOffset;
}
logo_bounds_.SetRect(logo_x, kDistributorLogoVerticalOffset, logo_w, logo_h);
@@ -995,7 +992,7 @@ void OpaqueNonClientView::LayoutTitleBar() {
// Size the title, if visible.
if (d->ShouldShowWindowTitle()) {
int spacing = d->ShouldShowWindowIcon() ? kWindowIconTitleSpacing : 0;
- int title_right = minimize_button_->GetX();
+ int title_right = minimize_button_->x();
int icon_right = icon_bounds_.right();
int title_left = icon_right + spacing;
title_bounds_.SetRect(title_left, kTitleTopOffset + top_offset,
@@ -1006,7 +1003,7 @@ void OpaqueNonClientView::LayoutTitleBar() {
void OpaqueNonClientView::LayoutClientView() {
gfx::Rect client_bounds(
- CalculateClientAreaBounds(GetWidth(), GetHeight()));
+ CalculateClientAreaBounds(width(), height()));
frame_->client_view()->SetBounds(client_bounds.ToRECT());
}
diff --git a/chrome/browser/views/hwnd_html_view.cc b/chrome/browser/views/hwnd_html_view.cc
index d1c543a..ebb610b 100644
--- a/chrome/browser/views/hwnd_html_view.cc
+++ b/chrome/browser/views/hwnd_html_view.cc
@@ -1,52 +1,52 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/views/hwnd_html_view.h"
-
-#include "chrome/browser/render_view_host.h"
-#include "chrome/browser/render_widget_host_hwnd.h"
-#include "chrome/browser/render_view_host_delegate.h"
-#include "chrome/browser/site_instance.h"
-#include "chrome/views/view_container.h"
-
-HWNDHtmlView::~HWNDHtmlView() {
- if (render_view_host_) {
- Detach();
- render_view_host_->Shutdown();
- render_view_host_ = NULL;
- }
-}
-
-void HWNDHtmlView::Init(HWND parent_hwnd) {
- DCHECK(!render_view_host_) << "Already initialized.";
- RenderViewHost* rvh = new RenderViewHost(
- SiteInstance::CreateSiteInstance(delegate_->GetProfile()),
- delegate_, MSG_ROUTING_NONE, NULL);
- render_view_host_ = rvh;
-
- RenderWidgetHostHWND* view = new RenderWidgetHostHWND(rvh);
- rvh->set_view(view);
-
- // Create the HWND. Note:
- // RenderWidgetHostHWND supports windowed plugins, but if we ever also wanted
- // to support constrained windows with this, we would need an additional
- // HWND to parent off of because windowed plugin HWNDs cannot exist in the
- // same z-order as constrained windows.
- HWND hwnd = view->Create(parent_hwnd);
- view->ShowWindow(SW_SHOW);
- ChromeViews::HWNDView::Attach(hwnd);
-
- // Start up the renderer.
- if (allow_dom_ui_bindings_)
- rvh->AllowDOMUIBindings();
- rvh->CreateRenderView();
- rvh->NavigateToURL(content_url_);
- initialized_ = true;
-}
-
-void HWNDHtmlView::ViewHierarchyChanged(bool is_add, View* parent,
- View* child) {
- if (is_add && GetViewContainer() && !initialized_)
- Init(GetViewContainer()->GetHWND());
-}
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/views/hwnd_html_view.h"
+
+#include "chrome/browser/render_view_host.h"
+#include "chrome/browser/render_widget_host_hwnd.h"
+#include "chrome/browser/render_view_host_delegate.h"
+#include "chrome/browser/site_instance.h"
+#include "chrome/views/view_container.h"
+
+HWNDHtmlView::~HWNDHtmlView() {
+ if (render_view_host_) {
+ Detach();
+ render_view_host_->Shutdown();
+ render_view_host_ = NULL;
+ }
+}
+
+void HWNDHtmlView::Init(HWND parent_hwnd) {
+ DCHECK(!render_view_host_) << "Already initialized.";
+ RenderViewHost* rvh = new RenderViewHost(
+ SiteInstance::CreateSiteInstance(delegate_->GetProfile()),
+ delegate_, MSG_ROUTING_NONE, NULL);
+ render_view_host_ = rvh;
+
+ RenderWidgetHostHWND* view = new RenderWidgetHostHWND(rvh);
+ rvh->set_view(view);
+
+ // Create the HWND. Note:
+ // RenderWidgetHostHWND supports windowed plugins, but if we ever also wanted
+ // to support constrained windows with this, we would need an additional
+ // HWND to parent off of because windowed plugin HWNDs cannot exist in the
+ // same z-order as constrained windows.
+ HWND hwnd = view->Create(parent_hwnd);
+ view->ShowWindow(SW_SHOW);
+ ChromeViews::HWNDView::Attach(hwnd);
+
+ // Start up the renderer.
+ if (allow_dom_ui_bindings_)
+ rvh->AllowDOMUIBindings();
+ rvh->CreateRenderView();
+ rvh->NavigateToURL(content_url_);
+ initialized_ = true;
+}
+
+void HWNDHtmlView::ViewHierarchyChanged(bool is_add, View* parent,
+ View* child) {
+ if (is_add && GetViewContainer() && !initialized_)
+ Init(GetViewContainer()->GetHWND());
+}
diff --git a/chrome/browser/views/hwnd_html_view.h b/chrome/browser/views/hwnd_html_view.h
index a0cd7e5..a91bb97 100644
--- a/chrome/browser/views/hwnd_html_view.h
+++ b/chrome/browser/views/hwnd_html_view.h
@@ -1,59 +1,59 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_VIEWS_HWND_HTML_VIEW_H_
-#define CHROME_BROWSER_VIEWS_HWND_HTML_VIEW_H_
-
-#include "googleurl/src/gurl.h"
-#include "chrome/views/hwnd_view.h"
-
-class RenderViewHost;
-class RenderViewHostDelegate;
-
-// A simple view that wraps a RenderViewHost in an HWNDView to facilitate
-// rendering HTML as arbitrary browser views.
-// TODO(timsteele): (bug 1317303). This should replace DOMView.
-class HWNDHtmlView : public ChromeViews::HWNDView {
- public:
- HWNDHtmlView(const GURL& content_url, RenderViewHostDelegate* delegate,
- bool allow_dom_ui_bindings)
- : render_view_host_(NULL),
- content_url_(content_url),
- allow_dom_ui_bindings_(allow_dom_ui_bindings),
- delegate_(delegate),
- initialized_(false) {
- }
- virtual ~HWNDHtmlView();
-
- RenderViewHost* render_view_host() { return render_view_host_; }
-
- protected:
- // View overrides.
- virtual void ViewHierarchyChanged(bool is_add, View *parent, View *child);
-
- private:
- // Initialize the view, parented to |parent|, and show it.
- void Init(HWND parent);
-
- // The URL of the HTML content to render and show in this view.
- GURL content_url_;
-
- // Our HTML rendering component.
- RenderViewHost* render_view_host_;
-
- // Whether or not the rendered content is permitted to send messages back to
- // the view, through |delegate_| via ProcessDOMUIMessage.
- bool allow_dom_ui_bindings_;
-
- // True after Init() has completed.
- bool initialized_;
-
- // The delegate for our render_view_host.
- RenderViewHostDelegate* delegate_;
-
- DISALLOW_EVIL_CONSTRUCTORS(HWNDHtmlView);
-};
-
-#endif // CHROME_BROWSER_VIEWS_HWND_HTML_VIEW_H_
-
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_VIEWS_HWND_HTML_VIEW_H_
+#define CHROME_BROWSER_VIEWS_HWND_HTML_VIEW_H_
+
+#include "googleurl/src/gurl.h"
+#include "chrome/views/hwnd_view.h"
+
+class RenderViewHost;
+class RenderViewHostDelegate;
+
+// A simple view that wraps a RenderViewHost in an HWNDView to facilitate
+// rendering HTML as arbitrary browser views.
+// TODO(timsteele): (bug 1317303). This should replace DOMView.
+class HWNDHtmlView : public ChromeViews::HWNDView {
+ public:
+ HWNDHtmlView(const GURL& content_url, RenderViewHostDelegate* delegate,
+ bool allow_dom_ui_bindings)
+ : render_view_host_(NULL),
+ content_url_(content_url),
+ allow_dom_ui_bindings_(allow_dom_ui_bindings),
+ delegate_(delegate),
+ initialized_(false) {
+ }
+ virtual ~HWNDHtmlView();
+
+ RenderViewHost* render_view_host() { return render_view_host_; }
+
+ protected:
+ // View overrides.
+ virtual void ViewHierarchyChanged(bool is_add, View *parent, View *child);
+
+ private:
+ // Initialize the view, parented to |parent|, and show it.
+ void Init(HWND parent);
+
+ // The URL of the HTML content to render and show in this view.
+ GURL content_url_;
+
+ // Our HTML rendering component.
+ RenderViewHost* render_view_host_;
+
+ // Whether or not the rendered content is permitted to send messages back to
+ // the view, through |delegate_| via ProcessDOMUIMessage.
+ bool allow_dom_ui_bindings_;
+
+ // True after Init() has completed.
+ bool initialized_;
+
+ // The delegate for our render_view_host.
+ RenderViewHostDelegate* delegate_;
+
+ DISALLOW_EVIL_CONSTRUCTORS(HWNDHtmlView);
+};
+
+#endif // CHROME_BROWSER_VIEWS_HWND_HTML_VIEW_H_
+
diff --git a/chrome/browser/views/importer_lock_view.cc b/chrome/browser/views/importer_lock_view.cc
index 2b8dc58..e3aec26 100644
--- a/chrome/browser/views/importer_lock_view.cc
+++ b/chrome/browser/views/importer_lock_view.cc
@@ -43,8 +43,8 @@ void ImporterLockView::GetPreferredSize(CSize *out) {
void ImporterLockView::Layout() {
description_label_->SetBounds(kPanelHorizMargin, kPanelVertMargin,
- GetWidth() - 2 * kPanelHorizMargin,
- GetHeight() - 2 * kPanelVertMargin);
+ width() - 2 * kPanelHorizMargin,
+ height() - 2 * kPanelVertMargin);
}
std::wstring ImporterLockView::GetDialogButtonLabel(
diff --git a/chrome/browser/views/info_bar_item_view.cc b/chrome/browser/views/info_bar_item_view.cc
index d5b7411..985b1c6 100644
--- a/chrome/browser/views/info_bar_item_view.cc
+++ b/chrome/browser/views/info_bar_item_view.cc
@@ -51,7 +51,7 @@ int InfoBarItemView::CenterPosition(int size, int target_size) {
}
void InfoBarItemView::GetPreferredSize(CSize* out) {
- out->cx = GetParent()->GetWidth();
+ out->cx = GetParent()->width();
out->cy = static_cast<int>(kInfoBarHeight * animation_->GetCurrentValue());
}
@@ -90,11 +90,8 @@ void InfoBarItemView::GetPreferredSize(CSize* out) {
// left views. Note in this case, the padding appears to the right of the view
// left aligned view. Removing works the same, but in reverse.
void InfoBarItemView::Layout() {
- const int width = GetWidth();
- const int height = GetHeight();
-
- int next_x = width - kButtonHEdgeMargin;
- int height_diff = static_cast<int>(kInfoBarHeight) - height;
+ int next_x = width() - kButtonHEdgeMargin;
+ int height_diff = static_cast<int>(kInfoBarHeight) - height();
const int child_count = GetChildViewCount();
// Anything greater than or equal to insert_index_ is laid out on the right,
// with the greatest index (the first one added to the right) being laid out
diff --git a/chrome/browser/views/info_bar_view.cc b/chrome/browser/views/info_bar_view.cc
index 56c2ecc..00a704f9 100644
--- a/chrome/browser/views/info_bar_view.cc
+++ b/chrome/browser/views/info_bar_view.cc
@@ -64,18 +64,15 @@ void InfoBarView::GetPreferredSize(CSize *out) {
if (v->IsVisible()) {
CSize view_size;
v->GetPreferredSize(&view_size);
- out->cx = std::max(static_cast<int>(out->cx), v->GetWidth());
+ out->cx = std::max(static_cast<int>(out->cx), v->width());
out->cy += static_cast<int>(view_size.cy) + kSeparatorHeight;
}
}
}
void InfoBarView::Layout() {
- int width = GetWidth();
- int height = GetHeight();
-
int x = 0;
- int y = height;
+ int y = height();
// We lay the bars out from bottom to top.
for (int i = 0; i < GetChildViewCount(); ++i) {
@@ -85,7 +82,7 @@ void InfoBarView::Layout() {
CSize view_size;
v->GetPreferredSize(&view_size);
- int view_width = std::max(static_cast<int>(view_size.cx), width);
+ int view_width = std::max(static_cast<int>(view_size.cx), width());
y = y - view_size.cy - kSeparatorHeight;
v->SetBounds(x,
y,
@@ -156,14 +153,14 @@ int InfoBarView::GetActiveID() const {
}
void InfoBarView::PaintBorder(ChromeCanvas* canvas) {
- canvas->FillRectInt(kBorderColorTop, 0, 0, GetWidth(), 1);
+ canvas->FillRectInt(kBorderColorTop, 0, 0, width(), 1);
canvas->FillRectInt(kBorderColorBottom,
- 0, GetHeight() - kSeparatorHeight - 1,
- GetWidth(), kSeparatorHeight);
+ 0, height() - kSeparatorHeight - 1,
+ width(), kSeparatorHeight);
if (GetChildViewCount() > 0)
- canvas->FillRectInt(kSeparatorColor, 0, GetHeight() - kSeparatorHeight,
- GetWidth(), kSeparatorHeight);
+ canvas->FillRectInt(kSeparatorColor, 0, height() - kSeparatorHeight,
+ width(), kSeparatorHeight);
}
void InfoBarView::PaintSeparators(ChromeCanvas* canvas) {
@@ -187,8 +184,8 @@ void InfoBarView::PaintSeparator(ChromeCanvas* canvas,
ChromeViews::View* v2) {
canvas->FillRectInt(kSeparatorColor,
0,
- v2->GetY() - kSeparatorHeight,
- GetWidth(),
+ v2->y() - kSeparatorHeight,
+ width(),
kSeparatorHeight);
}
diff --git a/chrome/browser/views/info_bubble.cc b/chrome/browser/views/info_bubble.cc
index 1a6dbca..0b6f3d6 100644
--- a/chrome/browser/views/info_bubble.cc
+++ b/chrome/browser/views/info_bubble.cc
@@ -251,15 +251,15 @@ void InfoBubble::ContentView::Layout() {
View* content = GetChildViewAt(0);
int x = kBorderSize;
int y = kBorderSize;
- int width = GetWidth() - kBorderSize - kBorderSize -
+ int content_width = width() - kBorderSize - kBorderSize -
kInfoBubbleViewLeftMargin - kInfoBubbleViewRightMargin;
- int height = GetHeight() - kBorderSize - kBorderSize - kArrowSize -
+ int content_height = height() - kBorderSize - kBorderSize - kArrowSize -
kInfoBubbleViewTopMargin - kInfoBubbleViewBottomMargin;
if (IsTop())
y += kArrowSize;
x += kInfoBubbleViewLeftMargin;
y += kInfoBubbleViewTopMargin;
- content->SetBounds(x, y, width, height);
+ content->SetBounds(x, y, content_width, content_height);
}
HRGN InfoBubble::ContentView::GetMask(const CSize &size) {
@@ -327,8 +327,8 @@ HRGN InfoBubble::ContentView::GetMask(const CSize &size) {
void InfoBubble::ContentView::Paint(ChromeCanvas* canvas) {
int bubble_x = 0;
int bubble_y = 0;
- int bubble_w = GetWidth();
- int bubble_h = GetHeight() - kArrowSize;
+ int bubble_w = width();
+ int bubble_h = height() - kArrowSize;
int border_w = bubble_w - 2 * kInfoBubbleCornerWidth;
int border_h = bubble_h - 2 * kInfoBubbleCornerHeight;
@@ -368,7 +368,7 @@ void InfoBubble::ContentView::Paint(ChromeCanvas* canvas) {
// Right border.
canvas->DrawRectInt(kBorderColor1,
- GetWidth() - 1, bubble_y + kInfoBubbleCornerHeight,
+ width() - 1, bubble_y + kInfoBubbleCornerHeight,
0, border_h);
// Draw the corners.
@@ -382,7 +382,7 @@ void InfoBubble::ContentView::Paint(ChromeCanvas* canvas) {
bubble_y + bubble_h - kInfoBubbleCornerHeight);
// Draw the arrow and the notch of the arrow.
- int arrow_x = IsLeft() ? kArrowXOffset : GetWidth() - kArrowXOffset;
+ int arrow_x = IsLeft() ? kArrowXOffset : width() - kArrowXOffset;
int arrow_y = IsTop() ? bubble_y : bubble_y + bubble_h - 1;
const int arrow_delta = IsTop() ? -1 : 1;
for (int i = 0, y = arrow_y; i <= kArrowSize; ++i, y += arrow_delta) {
diff --git a/chrome/browser/views/location_bar_view.cc b/chrome/browser/views/location_bar_view.cc
index d5eba49..dcdc5ae 100644
--- a/chrome/browser/views/location_bar_view.cc
+++ b/chrome/browser/views/location_bar_view.cc
@@ -234,11 +234,11 @@ void LocationBarView::Paint(ChromeCanvas* canvas) {
if (popup_window_mode_ == false) {
int bh = kBackground->height();
- canvas->TileImageInt(*kBackground, 0, (GetHeight() - bh) / 2, GetWidth(),
+ canvas->TileImageInt(*kBackground, 0, (height() - bh) / 2, width(),
bh);
canvas->FillRectInt(bg, kBackgroundHoriMargin, kBackgroundVertMargin,
- GetWidth() - 2 * kBackgroundHoriMargin,
+ width() - 2 * kBackgroundHoriMargin,
bh - kBackgroundVertMargin * 2);
} else {
canvas->TileImageInt(*kPopupBackgroundLeft, 0, 0,
@@ -246,18 +246,18 @@ void LocationBarView::Paint(ChromeCanvas* canvas) {
kPopupBackgroundLeft->height());
canvas->TileImageInt(*kPopupBackgroundCenter,
kPopupBackgroundLeft->width(), 0,
- GetWidth() -
+ width() -
kPopupBackgroundLeft->width() -
kPopupBackgroundRight->width(),
kPopupBackgroundCenter->height());
canvas->TileImageInt(*kPopupBackgroundRight,
- GetWidth() - kPopupBackgroundRight->width(),
+ width() - kPopupBackgroundRight->width(),
0, kPopupBackgroundRight->width(),
kPopupBackgroundRight->height());
canvas->FillRectInt(bg, kPopupBackgroundHorzMargin,
kPopupBackgroundVertMargin,
- GetWidth() - kPopupBackgroundHorzMargin * 2,
+ width() - kPopupBackgroundHorzMargin * 2,
kPopupBackgroundCenter->height() -
kPopupBackgroundVertMargin * 2);
}
@@ -374,7 +374,7 @@ void LocationBarView::DoLayout(const bool force_layout) {
RECT edit_bounds;
location_entry_->GetClientRect(&edit_bounds);
- int entry_width = GetWidth() - kEntryPadding - kEntryPadding;
+ int entry_width = width() - kEntryPadding - kEntryPadding;
CSize security_image_size;
if (security_image_view_.IsVisible()) {
security_image_view_.GetPreferredSize(&security_image_size);
@@ -401,17 +401,17 @@ void LocationBarView::DoLayout(const bool force_layout) {
const SkBitmap* background = popup_window_mode_ ? kPopupBackgroundCenter
: kBackground;
int bh = background->height();
- int location_y = ((GetHeight() - bh) / 2) + kTextVertMargin;
+ int location_y = ((height() - bh) / 2) + kTextVertMargin;
int location_height = bh - (2 * kTextVertMargin);
if (info_label_.IsVisible()) {
- info_label_.SetBounds(GetWidth() - kEntryPadding - info_label_size.cx,
+ info_label_.SetBounds(width() - kEntryPadding - info_label_size.cx,
location_y,
info_label_size.cx, location_height);
}
if (security_image_view_.IsVisible()) {
const int info_label_width = info_label_size.cx ?
info_label_size.cx + kInnerPadding : 0;
- security_image_view_.SetBounds(GetWidth() - kEntryPadding -
+ security_image_view_.SetBounds(width() - kEntryPadding -
info_label_width -
security_image_size.cx,
location_y,
@@ -447,7 +447,7 @@ int LocationBarView::TextDisplayWidth() {
POINT scroll_position;
location_entry_->GetScrollPos(&scroll_position);
const int position_x = last_char_position.x + scroll_position.x;
- return UILayoutIsRightToLeft() ? GetWidth() - position_x : position_x;
+ return UILayoutIsRightToLeft() ? width() - position_x : position_x;
}
bool LocationBarView::UsePref(int pref_width, int text_width, int max_width) {
@@ -459,7 +459,7 @@ bool LocationBarView::NeedsResize(View* view, int text_width, int max_width) {
view->GetPreferredSize(&size);
if (!UsePref(size.cx, text_width, max_width))
view->GetMinimumSize(&size);
- return (view->GetWidth() != size.cx);
+ return (view->width() != size.cx);
}
bool LocationBarView::AdjustHints(int text_width, int max_width) {
@@ -576,7 +576,7 @@ void LocationBarView::OnMouseEvent(const ChromeViews::MouseEvent& event,
if (event.IsRightMouseButton())
flags |= MK_RBUTTON;
- CPoint screen_point(event.GetX(), event.GetY());
+ CPoint screen_point(event.x(), event.y());
ConvertPointToScreen(this, &screen_point);
location_entry_->HandleExternalMsg(msg, flags, screen_point);
@@ -637,7 +637,7 @@ void LocationBarView::SelectedKeywordView::SetFont(const ChromeFont& font) {
void LocationBarView::SelectedKeywordView::Paint(ChromeCanvas* canvas) {
canvas->TranslateInt(0, kBackgroundYOffset);
- background_painter_.Paint(GetWidth(), GetHeight() - kTopInset, canvas);
+ background_painter_.Paint(width(), height() - kTopInset, canvas);
canvas->TranslateInt(0, -kBackgroundYOffset);
}
@@ -658,11 +658,11 @@ void LocationBarView::SelectedKeywordView::DidChangeBounds(
void LocationBarView::SelectedKeywordView::Layout() {
CSize pref;
GetPreferredSize(&pref);
- bool at_pref = (GetWidth() == pref.cx);
+ bool at_pref = (width() == pref.cx);
if (at_pref)
- full_label_.SetBounds(0, 0, GetWidth(), GetHeight());
+ full_label_.SetBounds(0, 0, width(), height());
else
- partial_label_.SetBounds(0, 0, GetWidth(), GetHeight());
+ partial_label_.SetBounds(0, 0, width(), height());
full_label_.SetVisible(at_pref);
partial_label_.SetVisible(!at_pref);
}
@@ -757,7 +757,7 @@ void LocationBarView::KeywordHintView::SetKeyword(const std::wstring& keyword) {
}
void LocationBarView::KeywordHintView::Paint(ChromeCanvas* canvas) {
- int image_x = leading_label_.IsVisible() ? leading_label_.GetWidth() : 0;
+ int image_x = leading_label_.IsVisible() ? leading_label_.width() : 0;
// Since we paint the button image directly on the canvas (instead of using a
// child view), we must mirror the button's position manually if the locale
@@ -791,21 +791,20 @@ void LocationBarView::KeywordHintView::GetMinimumSize(CSize* out) {
void LocationBarView::KeywordHintView::Layout() {
// TODO(sky): baseline layout.
- bool show_labels = (GetWidth() != kTabButtonBitmap->width());
+ bool show_labels = (width() != kTabButtonBitmap->width());
leading_label_.SetVisible(show_labels);
trailing_label_.SetVisible(show_labels);
- int height = GetHeight();
int x = 0;
CSize pref;
if (show_labels) {
leading_label_.GetPreferredSize(&pref);
- leading_label_.SetBounds(x, 0, pref.cx, height);
+ leading_label_.SetBounds(x, 0, pref.cx, height());
x += pref.cx + kTabButtonBitmap->width();
trailing_label_.GetPreferredSize(&pref);
- trailing_label_.SetBounds(x, 0, pref.cx, height);
+ trailing_label_.SetBounds(x, 0, pref.cx, height());
}
}
@@ -881,12 +880,12 @@ void LocationBarView::ShowFirstRunBubbleInternal() {
// therefore we need to adjust the X coordinate so that bubble appears on the
// right hand side of the location bar.
if (UILayoutIsRightToLeft())
- location.x += GetWidth();
+ location.x += width();
ChromeViews::View::ConvertPointToScreen(this, &location);
// We try to guess that 20 pixels offset is a good place for the first
// letter in the OmniBox.
- gfx::Rect bounds(location.x, location.y, 20, GetHeight());
+ gfx::Rect bounds(location.x, location.y, 20, height());
// Moving the bounds "backwards" so that it appears within the location bar
// if the UI layout is RTL.
@@ -957,7 +956,7 @@ void LocationBarView::SecurityImageView::ShowInfoBubble() {
CPoint location(0, 0);
ChromeViews::View::ConvertPointToScreen(this, &location);
- gfx::Rect bounds(location.x, location.y, GetWidth(), GetHeight());
+ gfx::Rect bounds(location.x, location.y, width(), height());
ChromeViews::Label* label = new ChromeViews::Label(text);
label->SetMultiLine(true);
diff --git a/chrome/browser/views/old_frames/frame_view.cc b/chrome/browser/views/old_frames/frame_view.cc
index 3375d07..dab87e9 100644
--- a/chrome/browser/views/old_frames/frame_view.cc
+++ b/chrome/browser/views/old_frames/frame_view.cc
@@ -75,19 +75,19 @@ bool FrameView::ShouldForwardToTabStrip(
if (!window_->GetTabStrip()->IsVisible())
return false;
- const int tab_y = window_->GetTabStrip()->GetY();
- const int tab_height = window_->GetTabStrip()->GetHeight();
- if (event.GetY() >= tab_y + tab_height)
+ const int tab_y = window_->GetTabStrip()->y();
+ const int tab_height = window_->GetTabStrip()->height();
+ if (event.y() >= tab_y + tab_height)
return false;
- if (event.GetY() >= tab_y)
+ if (event.y() >= tab_y)
return true;
// Mouse isn't over the tab strip. Only forward if the mouse isn't over
// another view on the tab strip or is over a view we were told the user can
// drop on.
ChromeViews::View* view_over_mouse =
- GetViewForPoint(CPoint(event.GetX(), event.GetY()));
+ GetViewForPoint(CPoint(event.x(), event.y()));
return (view_over_mouse == this ||
view_over_mouse == window_->GetTabStrip() ||
dropable_views_.find(view_over_mouse) != dropable_views_.end());
diff --git a/chrome/browser/views/old_frames/simple_vista_frame.cc b/chrome/browser/views/old_frames/simple_vista_frame.cc
index c7090d7..884d748 100644
--- a/chrome/browser/views/old_frames/simple_vista_frame.cc
+++ b/chrome/browser/views/old_frames/simple_vista_frame.cc
@@ -118,7 +118,7 @@ void SimpleVistaFrame::SizeToContents(const gfx::Rect& contents_bounds) {
GetBounds(&client_bounds, false);
int left_edge_width = client_bounds.left - window_bounds.left;
int top_edge_height = client_bounds.top - window_bounds.top +
- location_bar_->GetHeight();
+ location_bar_->height();
int right_edge_width = window_bounds.right - client_bounds.right;
int bottom_edge_height = window_bounds.bottom - client_bounds.bottom;
@@ -205,14 +205,14 @@ void SimpleVistaFrame::Layout() {
TabContentsContainerView* container = GetTabContentsContainer();
CSize s;
location_bar_->GetPreferredSize(&s);
- location_bar_->SetBounds(container->GetX() - kLocationBarOutdent,
- container->GetY() - kLocationBarOutdent,
- container->GetWidth() + kLocationBarOutdent * 2,
+ location_bar_->SetBounds(container->x() - kLocationBarOutdent,
+ container->y() - kLocationBarOutdent,
+ container->width() + kLocationBarOutdent * 2,
s.cy);
- container->SetBounds(container->GetX(),
- location_bar_->GetY() + location_bar_->GetHeight() -
- kLocationBarSpacing, container->GetWidth(),
- container->GetHeight() - location_bar_->GetHeight() +
+ container->SetBounds(container->x(),
+ location_bar_->y() + location_bar_->height() -
+ kLocationBarSpacing, container->width(),
+ container->height() - location_bar_->height() +
3);
location_bar_->SetVisible(true);
location_bar_->Layout();
diff --git a/chrome/browser/views/old_frames/simple_xp_frame.cc b/chrome/browser/views/old_frames/simple_xp_frame.cc
index d4bf51a..44a5a54 100644
--- a/chrome/browser/views/old_frames/simple_xp_frame.cc
+++ b/chrome/browser/views/old_frames/simple_xp_frame.cc
@@ -93,7 +93,7 @@ void TitleBarMenuButton::GetPreferredSize(CSize *out) {
void TitleBarMenuButton::Paint(ChromeCanvas* canvas) {
if (GetState() == TextButton::BS_HOT ||
GetState() == TextButton::BS_PUSHED || menu_visible_) {
- canvas->FillRectInt(kHotColor, 0, 0, GetWidth(), GetHeight());
+ canvas->FillRectInt(kHotColor, 0, 0, width(), height());
}
if (contents_) {
@@ -104,8 +104,8 @@ void TitleBarMenuButton::Paint(ChromeCanvas* canvas) {
PaintFloatingView(canvas,
contents_,
kVertBorderSize,
- (GetHeight() - s.cy) / 2,
- GetWidth() - kHorizMargin - drop_arrow_->width() -
+ (height() - s.cy) / 2,
+ width() - kHorizMargin - drop_arrow_->width() -
(2 * kHorizBorderSize),
s.cy);
}
@@ -114,8 +114,8 @@ void TitleBarMenuButton::Paint(ChromeCanvas* canvas) {
// mirror the drop down arrow because is is drawn directly on the canvas
// (instead of using a child View). Thus, we should mirror its position
// manually.
- gfx::Rect arrow_bounds(GetWidth() - drop_arrow_->width() - kHorizBorderSize,
- (GetHeight() - drop_arrow_->height()) / 2,
+ gfx::Rect arrow_bounds(width() - drop_arrow_->width() - kHorizBorderSize,
+ (height() - drop_arrow_->height()) / 2,
drop_arrow_->width(),
drop_arrow_->height());
arrow_bounds.set_x(MirroredLeftPointForRect(arrow_bounds));
@@ -124,7 +124,7 @@ void TitleBarMenuButton::Paint(ChromeCanvas* canvas) {
bool TitleBarMenuButton::OnMousePressed(const ChromeViews::MouseEvent& e) {
if (e.GetFlags() & ChromeViews::MouseEvent::EF_IS_DOUBLE_CLICK) {
- if (!HitTest(WTL::CPoint(e.GetX(), e.GetY())))
+ if (!HitTest(WTL::CPoint(e.x(), e.y())))
return true;
title_bar_->CloseWindow();
return true;
@@ -196,10 +196,10 @@ void SimpleXPFrameTitleBar::RunMenu(ChromeViews::View* source,
// flag. We also adjust the menu position because RTL menus use a different
// anchor point.
CPoint p(menu_button_->GetX(APPLY_MIRRORING_TRANSFORMATION),
- menu_button_->GetY() + menu_button_->GetHeight());
+ menu_button_->y() + menu_button_->height());
if (UILayoutIsRightToLeft())
- p.x += menu_button_->GetWidth();
+ p.x += menu_button_->width();
View::ConvertPointToScreen(this, &p);
parent_->RunMenu(p, hwnd);
}
@@ -207,14 +207,14 @@ void SimpleXPFrameTitleBar::RunMenu(ChromeViews::View* source,
void SimpleXPFrameTitleBar::Layout() {
CSize s;
menu_button_->GetPreferredSize(&s);
- menu_button_->SetBounds(kFavIconMargin, (GetHeight() - s.cy) / 2,
+ menu_button_->SetBounds(kFavIconMargin, (height() - s.cy) / 2,
s.cx, s.cy);
menu_button_->Layout();
- label_->SetBounds(menu_button_->GetX() + menu_button_->GetWidth() +
+ label_->SetBounds(menu_button_->x() + menu_button_->width() +
kFavIconPadding, kLabelVerticalOffset,
- GetWidth() - (menu_button_->GetX() +
- menu_button_->GetWidth() + kFavIconPadding),
- GetHeight());
+ width() - (menu_button_->x() +
+ menu_button_->width() + kFavIconPadding),
+ height());
}
bool SimpleXPFrameTitleBar::WillHandleMouseEvent(int x, int y) {
@@ -222,7 +222,7 @@ bool SimpleXPFrameTitleBar::WillHandleMouseEvent(int x, int y) {
// a way that returns the mirrored position and not the position set using
// SetX()/SetBounds().
CPoint p(x - menu_button_->GetX(APPLY_MIRRORING_TRANSFORMATION),
- y - menu_button_->GetY());
+ y - menu_button_->y());
return menu_button_->HitTest(p);
}
@@ -314,8 +314,8 @@ void SimpleXPFrame::Layout() {
if (IsTitleBarVisible()) {
TabContentsContainerView* tccv = GetTabContentsContainer();
DCHECK(tccv);
- title_bar_->SetBounds(tccv->GetX(), 0,
- GetButtonXOrigin() - tccv->GetX(),
+ title_bar_->SetBounds(tccv->x(), 0,
+ GetButtonXOrigin() - tccv->x(),
GetContentsYOrigin());
title_bar_->Layout();
}
@@ -324,14 +324,14 @@ void SimpleXPFrame::Layout() {
TabContentsContainerView* container = GetTabContentsContainer();
CSize s;
location_bar_->GetPreferredSize(&s);
- location_bar_->SetBounds(container->GetX() - kLocationBarOffset,
- container->GetY(),
- container->GetWidth() + kLocationBarOffset * 2,
+ location_bar_->SetBounds(container->x() - kLocationBarOffset,
+ container->y(),
+ container->width() + kLocationBarOffset * 2,
s.cy);
- container->SetBounds(container->GetX(),
- location_bar_->GetY() + location_bar_->GetHeight() +
- kLocationBarSpacing, container->GetWidth(),
- container->GetHeight() - location_bar_->GetHeight() -
+ container->SetBounds(container->x(),
+ location_bar_->y() + location_bar_->height() +
+ kLocationBarSpacing, container->width(),
+ container->height() - location_bar_->height() -
1);
location_bar_->SetVisible(true);
location_bar_->Layout();
@@ -346,8 +346,8 @@ LRESULT SimpleXPFrame::OnNCHitTest(const CPoint& pt) {
ChromeViews::View::ConvertPointToView(NULL, title_bar_, &p);
if (!title_bar_->WillHandleMouseEvent(p.x, p.y) &&
p.x >= 0 && p.y >= kTopResizeBarHeight &&
- p.x < title_bar_->GetWidth() &&
- p.y < title_bar_->GetHeight()) {
+ p.x < title_bar_->width() &&
+ p.y < title_bar_->height()) {
return HTCAPTION;
}
}
diff --git a/chrome/browser/views/old_frames/vista_frame.cc b/chrome/browser/views/old_frames/vista_frame.cc
index ef531c0..3c25943 100644
--- a/chrome/browser/views/old_frames/vista_frame.cc
+++ b/chrome/browser/views/old_frames/vista_frame.cc
@@ -265,8 +265,8 @@ void VistaFrame::Layout() {
tabstrip_bounds.width(),
tabstrip_bounds.height());
- frame_view_->SetContentsOffset(tabstrip_->GetY() +
- tabstrip_->GetHeight() -
+ frame_view_->SetContentsOffset(tabstrip_->y() +
+ tabstrip_->height() -
kToolbarOverlapVertOffset);
} else {
tabstrip_->SetBounds(0, 0, 0, 0);
@@ -279,17 +279,17 @@ void VistaFrame::Layout() {
if (IsToolBarVisible()) {
browser_view_->SetVisible(true);
browser_view_->SetBounds(g_bitmaps[CT_LEFT_SIDE]->width(),
- tabstrip_->GetY() + tabstrip_->GetHeight() -
+ tabstrip_->y() + tabstrip_->height() -
kToolbarOverlapVertOffset,
width - g_bitmaps[CT_LEFT_SIDE]->width() -
g_bitmaps[CT_RIGHT_SIDE]->width(),
g_bitmaps[CT_TOP_CENTER]->height());
browser_view_->Layout();
- toolbar_bottom = browser_view_->GetY() + browser_view_->GetHeight();
+ toolbar_bottom = browser_view_->y() + browser_view_->height();
} else {
browser_view_->SetBounds(0, 0, 0, 0);
browser_view_->SetVisible(false);
- toolbar_bottom = tabstrip_->GetY() + tabstrip_->GetHeight();
+ toolbar_bottom = tabstrip_->y() + tabstrip_->height();
}
int browser_x, browser_y;
int browser_w, browser_h;
@@ -581,8 +581,8 @@ bool VistaFrame::IsMaximized() {
}
gfx::Rect VistaFrame::GetBoundsForContentBounds(const gfx::Rect content_rect) {
- if (tab_contents_container_->GetX() == 0 &&
- tab_contents_container_->GetWidth() == 0) {
+ if (tab_contents_container_->x() == 0 &&
+ tab_contents_container_->width() == 0) {
Layout();
}
@@ -595,10 +595,10 @@ gfx::Rect VistaFrame::GetBoundsForContentBounds(const gfx::Rect content_rect) {
r.set_x(content_rect.x() - p.x);
r.set_y(content_rect.y() - p.y);
r.set_width(p.x + content_rect.width() +
- (bounds.Width() - (p.x + tab_contents_container_->GetWidth())));
+ (bounds.Width() - (p.x + tab_contents_container_->width())));
r.set_height(p.y + content_rect.height() +
(bounds.Height() - (p.y +
- tab_contents_container_->GetHeight())));
+ tab_contents_container_->height())));
return r;
}
@@ -975,8 +975,8 @@ LRESULT VistaFrame::OnNCHitTest(const CPoint& pt) {
// If we are over the tabstrip
if (tab_pt.x > 0 && tab_pt.y >= kTabShadowSize &&
- tab_pt.x < tabstrip_->GetWidth() &&
- tab_pt.y < tabstrip_->GetHeight()) {
+ tab_pt.x < tabstrip_->width() &&
+ tab_pt.y < tabstrip_->height()) {
ChromeViews::View* v = tabstrip_->GetViewForPoint(tab_pt);
if (v == tabstrip_)
return HTCAPTION;
@@ -1039,7 +1039,7 @@ LRESULT VistaFrame::OnNCHitTest(const CPoint& pt) {
return HTBOTTOM;
}
- if (p.y <= tabstrip_->GetY() + tabstrip_->GetHeight()) {
+ if (p.y <= tabstrip_->y() + tabstrip_->height()) {
return HTCAPTION;
}
@@ -1281,19 +1281,19 @@ void VistaFrame::VistaFrameView::Paint(ChromeCanvas* canvas) {
// When painting the border, exclude the contents area. This will prevent the
// border bitmaps (which might be larger than the visible area) from coming
// into the content area when there is no tab painted yet.
- int x = parent_->tab_contents_container_->GetX();
- int y = parent_->tab_contents_container_->GetY();
+ int x = parent_->tab_contents_container_->x();
+ int y = parent_->tab_contents_container_->y();
SkRect clip;
clip.set(SkIntToScalar(x), SkIntToScalar(y),
- SkIntToScalar(x + parent_->tab_contents_container_->GetWidth()),
- SkIntToScalar(y + parent_->tab_contents_container_->GetHeight()));
+ SkIntToScalar(x + parent_->tab_contents_container_->width()),
+ SkIntToScalar(y + parent_->tab_contents_container_->height()));
canvas->clipRect(clip, SkRegion::kDifference_Op);
PaintContentsBorder(canvas,
0,
contents_offset_,
- GetWidth(),
- GetHeight() - contents_offset_);
+ width(),
+ height() - contents_offset_);
canvas->restore();
}
@@ -1361,7 +1361,7 @@ bool VistaFrame::VistaFrameView::ShouldForwardToTabStrip(
if (min_x != std::numeric_limits<int>::max() &&
max_x != std::numeric_limits<int>::min() &&
max_y != std::numeric_limits<int>::min()) {
- CPoint screen_drag_point(event.GetX(), event.GetY());
+ CPoint screen_drag_point(event.x(), event.y());
ConvertPointToScreen(this, &screen_drag_point);
if (screen_drag_point.x >= min_x && screen_drag_point.x <= max_x &&
screen_drag_point.y <= max_y) {
@@ -1414,8 +1414,8 @@ void VistaFrame::ResetDWMFrame() {
g_bitmaps[CT_TOP_RIGHT_CORNER]->width(),
kDwmBorderSize +
IsToolBarVisible() ?
- browser_view_->GetY() + kToolbarOverlapVertOffset :
- tabstrip_->GetHeight(),
+ browser_view_->y() + kToolbarOverlapVertOffset :
+ tabstrip_->height(),
kDwmBorderSize +
g_bitmaps[CT_BOTTOM_CENTER]->height()};
@@ -1446,7 +1446,7 @@ bool VistaFrame::UpdateChildViewAndLayout(ChromeViews::View* new_view,
if (new_view) {
CSize pref_size;
new_view->GetPreferredSize(&pref_size);
- if (pref_size.cy != new_view->GetHeight())
+ if (pref_size.cy != new_view->height())
return true;
}
return false;
@@ -1459,7 +1459,7 @@ bool VistaFrame::UpdateChildViewAndLayout(ChromeViews::View* new_view,
int current_height = 0;
if (*view) {
- current_height = (*view)->GetHeight();
+ current_height = (*view)->height();
root_view_.RemoveChildView(*view);
}
diff --git a/chrome/browser/views/old_frames/xp_frame.cc b/chrome/browser/views/old_frames/xp_frame.cc
index 1a02f3a..8e3978f 100644
--- a/chrome/browser/views/old_frames/xp_frame.cc
+++ b/chrome/browser/views/old_frames/xp_frame.cc
@@ -559,12 +559,12 @@ void* XPFrame::GetPlatformID() {
}
int XPFrame::GetContentsYOrigin() {
- int min_y = tab_contents_container_->GetY();
+ int min_y = tab_contents_container_->y();
if (info_bar_view_)
- min_y = std::min(min_y, info_bar_view_->GetY());
+ min_y = std::min(min_y, info_bar_view_->y());
if (bookmark_bar_view_.get())
- min_y = std::min(min_y, bookmark_bar_view_->GetY());
+ min_y = std::min(min_y, bookmark_bar_view_->y());
return min_y;
}
@@ -605,7 +605,7 @@ void XPFrame::Layout() {
restore_button_->GetPreferredSize(&preferred_size);
restore_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT,
ChromeViews::Button::ALIGN_BOTTOM);
- restore_button_->SetBounds(close_button_->GetX() - preferred_size.cx,
+ restore_button_->SetBounds(close_button_->x() - preferred_size.cx,
0,
preferred_size.cx,
preferred_size.cy +
@@ -614,7 +614,7 @@ void XPFrame::Layout() {
min_button_->GetPreferredSize(&preferred_size);
min_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT,
ChromeViews::Button::ALIGN_BOTTOM);
- min_button_->SetBounds(restore_button_->GetX() - preferred_size.cx,
+ min_button_->SetBounds(restore_button_->x() - preferred_size.cx,
0,
preferred_size.cx,
preferred_size.cy +
@@ -636,7 +636,7 @@ void XPFrame::Layout() {
max_button_->GetPreferredSize(&preferred_size);
max_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT,
ChromeViews::Button::ALIGN_TOP);
- max_button_->SetBounds(close_button_->GetX() - preferred_size.cx,
+ max_button_->SetBounds(close_button_->x() - preferred_size.cx,
kWindowControlsTopOffset,
preferred_size.cx,
preferred_size.cy);
@@ -644,13 +644,13 @@ void XPFrame::Layout() {
min_button_->GetPreferredSize(&preferred_size);
min_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT,
ChromeViews::Button::ALIGN_TOP);
- min_button_->SetBounds(max_button_->GetX() - preferred_size.cx,
+ min_button_->SetBounds(max_button_->x() - preferred_size.cx,
kWindowControlsTopOffset,
preferred_size.cx,
preferred_size.cy);
}
- int right_limit = min_button_->GetX();
+ int right_limit = min_button_->x();
int left_margin;
int right_margin;
int bottom_margin;
@@ -702,7 +702,7 @@ void XPFrame::Layout() {
CSize distributor_logo_size;
distributor_logo_->GetPreferredSize(&distributor_logo_size);
distributor_logo_->SetVisible(true);
- distributor_logo_->SetBounds(min_button_->GetX() -
+ distributor_logo_->SetBounds(min_button_->x() -
distributor_logo_size.cx -
kDistributorLogoHorizontalOffset,
kDistributorLogoVerticalOffset,
@@ -715,7 +715,7 @@ void XPFrame::Layout() {
right_limit - tab_strip_x - right_margin,
tabstrip_->GetPreferredHeight());
- last_y = tabstrip_->GetY() + tabstrip_->GetHeight();
+ last_y = tabstrip_->y() + tabstrip_->height();
} else {
tabstrip_->SetBounds(0, 0, 0, 0);
tabstrip_->SetVisible(false);
@@ -736,8 +736,8 @@ void XPFrame::Layout() {
browser_view_width,
bitmaps[CT_TOP_CENTER]->height());
browser_view_->Layout();
- title_bar_height_ = browser_view_->GetY();
- last_y = browser_view_->GetY() + browser_view_->GetHeight();
+ title_bar_height_ = browser_view_->y();
+ last_y = browser_view_->y() + browser_view_->height();
} else {
// If the tab strip is visible, we need to expose the toolbar for a small
// offset. (kCollapsedToolbarHeight).
@@ -746,7 +746,7 @@ void XPFrame::Layout() {
last_y += kCollapsedToolbarHeight;
} else {
last_y = std::max(kMinTitleBarHeight,
- close_button_->GetY() + close_button_->GetHeight());
+ close_button_->y() + close_button_->height());
title_bar_height_ = last_y;
}
browser_view_->SetVisible(false);
@@ -1724,10 +1724,10 @@ XPFrame::ResizeMode XPFrame::ComputeResizeMode(int x,
int width,
int height) {
// Make sure we're not over a window control (they overlap our resize area).
- if (x >= min_button_->GetX() &&
- x < close_button_->GetX() + close_button_->GetWidth() &&
- y >= min_button_->GetY() &&
- y < min_button_->GetY() + min_button_->GetHeight()) {
+ if (x >= min_button_->x() &&
+ x < close_button_->x() + close_button_->width() &&
+ y >= min_button_->y() &&
+ y < min_button_->y() + min_button_->height()) {
return RM_UNDEFINED;
}
@@ -1811,8 +1811,8 @@ bool XPFrame::IsMaximized() {
}
gfx::Rect XPFrame::GetBoundsForContentBounds(const gfx::Rect content_rect) {
- if (tab_contents_container_->GetX() == 0 &&
- tab_contents_container_->GetWidth() == 0) {
+ if (tab_contents_container_->x() == 0 &&
+ tab_contents_container_->width() == 0) {
Layout();
}
@@ -1825,10 +1825,10 @@ gfx::Rect XPFrame::GetBoundsForContentBounds(const gfx::Rect content_rect) {
r.set_x(content_rect.x() - p.x);
r.set_y(content_rect.y() - p.y);
r.set_width(p.x + content_rect.width() +
- (bounds.Width() - (p.x + tab_contents_container_->GetWidth())));
+ (bounds.Width() - (p.x + tab_contents_container_->width())));
r.set_height(p.y + content_rect.height() +
(bounds.Height() - (p.y +
- tab_contents_container_->GetHeight())));
+ tab_contents_container_->height())));
return r;
}
@@ -2000,8 +2000,6 @@ void XPFrame::ProcessMouseExited() {
////////////////////////////////////////////////////////////////////////////////
void XPFrame::XPFrameView::PaintFrameBorder(ChromeCanvas* canvas) {
- int width = GetWidth();
- int height = GetHeight();
int x, y;
x = 0;
y = 0;
@@ -2037,9 +2035,9 @@ void XPFrame::XPFrameView::PaintFrameBorder(ChromeCanvas* canvas) {
bottom_right_corner = bitmaps[DE_BOTTOM_RIGHT_CORNER];
}
- int variable_width = width - top_left_corner->width() -
+ int variable_width = width() - top_left_corner->width() -
top_right_corner->width();
- int variable_height = height - top_right_corner->height() -
+ int variable_height = height() - top_right_corner->height() -
bottom_right_corner->height();
// Top
@@ -2049,7 +2047,7 @@ void XPFrame::XPFrameView::PaintFrameBorder(ChromeCanvas* canvas) {
y,
variable_width,
top_center->height());
- x = width - top_right_corner->width();
+ x = width() - top_right_corner->width();
canvas->DrawBitmapInt(*top_right_corner, x, y);
// Right side
@@ -2061,16 +2059,16 @@ void XPFrame::XPFrameView::PaintFrameBorder(ChromeCanvas* canvas) {
// Bottom
canvas->DrawBitmapInt(*bottom_right_corner,
- width - bottom_right_corner->width(),
- height - bottom_right_corner->height());
+ width() - bottom_right_corner->width(),
+ height() - bottom_right_corner->height());
canvas->TileImageInt(*bottom_center,
bottom_left_corner->width(),
- height - bottom_center->height(),
+ height() - bottom_center->height(),
variable_width,
bottom_center->height());
canvas->DrawBitmapInt(*bottom_left_corner,
0,
- height - bottom_left_corner->height());
+ height() - bottom_left_corner->height());
// Left
canvas->TileImageInt(*left_side,
@@ -2081,9 +2079,6 @@ void XPFrame::XPFrameView::PaintFrameBorder(ChromeCanvas* canvas) {
}
void XPFrame::XPFrameView::PaintFrameBorderZoomed(ChromeCanvas* canvas) {
- int width = GetWidth();
- int height = GetHeight();
-
static const SkBitmap * maximized_top;
static const SkBitmap * maximized_bottom;
@@ -2099,12 +2094,12 @@ void XPFrame::XPFrameView::PaintFrameBorderZoomed(ChromeCanvas* canvas) {
canvas->TileImageInt(*maximized_top,
0,
0,
- width,
+ width(),
maximized_top->height());
canvas->TileImageInt(*maximized_bottom,
0,
- height - maximized_bottom->height(),
- width,
+ height() - maximized_bottom->height(),
+ width(),
maximized_bottom->height());
}
@@ -2211,12 +2206,12 @@ void XPFrame::XPFrameView::Paint(ChromeCanvas* canvas) {
// When painting the border, exclude the contents area. This will prevent the
// border bitmaps (which might be larger than the visible area) from coming
// into the content area when there is no tab painted yet.
- int x = parent_->tab_contents_container_->GetX();
- int y = parent_->tab_contents_container_->GetY();
+ int x = parent_->tab_contents_container_->x();
+ int y = parent_->tab_contents_container_->y();
SkRect clip;
clip.set(SkIntToScalar(x), SkIntToScalar(y),
- SkIntToScalar(x + parent_->tab_contents_container_->GetWidth()),
- SkIntToScalar(y + parent_->tab_contents_container_->GetHeight()));
+ SkIntToScalar(x + parent_->tab_contents_container_->width()),
+ SkIntToScalar(y + parent_->tab_contents_container_->height()));
canvas->clipRect(clip, SkRegion::kDifference_Op);
if (parent_->IsZoomed()) {
@@ -2224,7 +2219,7 @@ void XPFrame::XPFrameView::Paint(ChromeCanvas* canvas) {
int y;
bool should_draw_separator = false;
if (parent_->IsToolBarVisible()) {
- y = parent_->browser_view_->GetY();
+ y = parent_->browser_view_->y();
} else if (parent_->IsTabStripVisible()) {
y = parent_->GetContentsYOrigin() - kCollapsedToolbarHeight -
kToolbarOverlapVertOffset;
@@ -2232,13 +2227,13 @@ void XPFrame::XPFrameView::Paint(ChromeCanvas* canvas) {
y = parent_->GetContentsYOrigin();
}
- PaintContentsBorderZoomed(canvas, 0, y, GetWidth());
+ PaintContentsBorderZoomed(canvas, 0, y, width());
} else {
PaintFrameBorder(canvas);
- int y, height;
+ int y, frame_height;
if (parent_->IsToolBarVisible()) {
- y = parent_->browser_view_->GetY();
- height = GetHeight() - (parent_->browser_view_->GetY() +
+ y = parent_->browser_view_->y();
+ frame_height = height() - (parent_->browser_view_->y() +
kContentBorderVertBottomOffset);
} else {
if (parent_->IsTabStripVisible()) {
@@ -2247,12 +2242,12 @@ void XPFrame::XPFrameView::Paint(ChromeCanvas* canvas) {
} else {
y = parent_->GetContentsYOrigin();
}
- height = GetHeight() - y - kContentBorderVertBottomOffset;
+ frame_height = height() - y - kContentBorderVertBottomOffset;
}
PaintContentsBorder(canvas, kContentBorderHorizOffset, y,
- GetWidth() - (2 * kContentBorderHorizOffset),
- height);
+ width() - (2 * kContentBorderHorizOffset),
+ frame_height);
}
canvas->restore();
@@ -2282,9 +2277,9 @@ bool XPFrame::XPFrameView::ShouldForwardToTabStrip(
const ChromeViews::DropTargetEvent& event) {
if (!FrameView::ShouldForwardToTabStrip(event))
return false;
- if (parent_->IsZoomed() && event.GetX() >= parent_->min_button_->GetX() &&
- event.GetY() < (parent_->min_button_->GetY() +
- parent_->min_button_->GetHeight())) {
+ if (parent_->IsZoomed() && event.x() >= parent_->min_button_->x() &&
+ event.y() < (parent_->min_button_->y() +
+ parent_->min_button_->height())) {
return false;
}
return true;
@@ -2313,7 +2308,7 @@ bool XPFrame::UpdateChildViewAndLayout(ChromeViews::View* new_view,
if (new_view) {
CSize pref_size;
new_view->GetPreferredSize(&pref_size);
- if (pref_size.cy != new_view->GetHeight())
+ if (pref_size.cy != new_view->height())
return true;
}
return false;
@@ -2326,7 +2321,7 @@ bool XPFrame::UpdateChildViewAndLayout(ChromeViews::View* new_view,
int current_height = 0;
if (*view) {
- current_height = (*view)->GetHeight();
+ current_height = (*view)->height();
root_view_.RemoveChildView(*view);
}
diff --git a/chrome/browser/views/old_frames/xp_frame.h b/chrome/browser/views/old_frames/xp_frame.h
index e91ffff..89df94c 100644
--- a/chrome/browser/views/old_frames/xp_frame.h
+++ b/chrome/browser/views/old_frames/xp_frame.h
@@ -224,7 +224,7 @@ class XPFrame : public BrowserWindow,
// Return the X origin of the the first frame control button.
int GetButtonXOrigin() {
- return min_button_->GetX();
+ return min_button_->x();
}
// Return the Y location of the contents or infobar.
diff --git a/chrome/browser/views/options/advanced_contents_view.cc b/chrome/browser/views/options/advanced_contents_view.cc
index fe00d42..c063e33 100644
--- a/chrome/browser/views/options/advanced_contents_view.cc
+++ b/chrome/browser/views/options/advanced_contents_view.cc
@@ -385,8 +385,8 @@ void GeneralSection::Layout() {
// do this then it will return 0 as a preferred width when GridLayout (called
// from View::Layout) tries to access it.
ChromeViews::View* parent = GetParent();
- if (parent && parent->GetWidth()) {
- const int parent_width = parent->GetWidth();
+ if (parent && parent->width()) {
+ const int parent_width = parent->width();
reporting_enabled_checkbox_->SetBounds(0, 0, parent_width - 20, 0);
}
View::Layout();
@@ -1101,8 +1101,8 @@ int AdvancedContentsView::GetLineScrollIncrement(
void AdvancedContentsView::Layout() {
ChromeViews::View* parent = GetParent();
- if (parent && parent->GetWidth()) {
- const int width = parent->GetWidth();
+ if (parent && parent->width()) {
+ const int width = parent->width();
const int height = GetHeightForWidth(width);
SetBounds(0, 0, width, height);
} else {
diff --git a/chrome/browser/views/options/content_page_view.cc b/chrome/browser/views/options/content_page_view.cc
index d138840a..bb70905 100644
--- a/chrome/browser/views/options/content_page_view.cc
+++ b/chrome/browser/views/options/content_page_view.cc
@@ -99,7 +99,7 @@ void FileDisplayArea::SetFile(const std::wstring& file_path) {
void FileDisplayArea::Paint(ChromeCanvas* canvas) {
HDC dc = canvas->beginPlatformPaint();
- RECT rect = { 0, 0, GetWidth(), GetHeight() };
+ RECT rect = { 0, 0, width(), height() };
gfx::NativeTheme::instance()->PaintTextField(
dc, EP_EDITTEXT, ETS_READONLY, 0, &rect,
gfx::SkColorToCOLORREF(text_field_background_color_), true, true);
@@ -114,8 +114,8 @@ void FileDisplayArea::Layout() {
CSize ps;
text_field_->GetPreferredSize(&ps);
text_field_->SetBounds(icon_bounds_.right() + kFileIconTextFieldSpacing,
- (GetHeight() - ps.cy) / 2,
- GetWidth() - icon_bounds_.right() -
+ (height() - ps.cy) / 2,
+ width() - icon_bounds_.right() -
kFileIconHorizontalSpacing -
kFileIconTextFieldSpacing, ps.cy);
}
diff --git a/chrome/browser/views/options/cookies_view.cc b/chrome/browser/views/options/cookies_view.cc
index 5ba17fd..888e37d 100644
--- a/chrome/browser/views/options/cookies_view.cc
+++ b/chrome/browser/views/options/cookies_view.cc
@@ -645,7 +645,7 @@ void CookiesView::Layout() {
remove_button_->SetBounds(kPanelHorizMargin, y_buttons, ps.cx, ps.cy);
remove_all_button_->GetPreferredSize(&ps);
- int remove_all_x = remove_button_->GetX() + remove_button_->GetWidth() +
+ int remove_all_x = remove_button_->x() + remove_button_->width() +
kRelatedControlHorizontalSpacing;
remove_all_button_->SetBounds(remove_all_x, y_buttons, ps.cx, ps.cy);
diff --git a/chrome/browser/views/options/fonts_languages_window_view.cc b/chrome/browser/views/options/fonts_languages_window_view.cc
index fb87568..54c6952 100644
--- a/chrome/browser/views/options/fonts_languages_window_view.cc
+++ b/chrome/browser/views/options/fonts_languages_window_view.cc
@@ -63,8 +63,8 @@ ChromeViews::View* FontsLanguagesWindowView::GetContentsView() {
void FontsLanguagesWindowView::Layout() {
tabs_->SetBounds(kDialogPadding, kDialogPadding,
- GetWidth() - (2 * kDialogPadding),
- GetHeight() - (2 * kDialogPadding));
+ width() - (2 * kDialogPadding),
+ height() - (2 * kDialogPadding));
}
void FontsLanguagesWindowView::GetPreferredSize(CSize* out) {
diff --git a/chrome/browser/views/options/fonts_page_view.cc b/chrome/browser/views/options/fonts_page_view.cc
index 0d9c559b..db44561 100644
--- a/chrome/browser/views/options/fonts_page_view.cc
+++ b/chrome/browser/views/options/fonts_page_view.cc
@@ -158,7 +158,7 @@ void FontDisplayView::SetFontType(const std::wstring& font_name,
void FontDisplayView::Paint(ChromeCanvas* canvas) {
HDC dc = canvas->beginPlatformPaint();
- RECT rect = { 0, 0, GetWidth(), GetHeight() };
+ RECT rect = { 0, 0, width(), height() };
gfx::NativeTheme::instance()->PaintTextField(
dc, EP_BACKGROUND, EBS_NORMAL, 0, &rect, ::GetSysColor(COLOR_3DFACE),
true, true);
@@ -166,7 +166,7 @@ void FontDisplayView::Paint(ChromeCanvas* canvas) {
}
void FontDisplayView::Layout() {
- font_text_label_->SetBounds(0, 0, GetWidth(), GetHeight());
+ font_text_label_->SetBounds(0, 0, width(), height());
}
void FontDisplayView::GetPreferredSize(CSize* out) {
diff --git a/chrome/browser/views/options/languages_page_view.cc b/chrome/browser/views/options/languages_page_view.cc
index aa0e3b3..27a00e5 100644
--- a/chrome/browser/views/options/languages_page_view.cc
+++ b/chrome/browser/views/options/languages_page_view.cc
@@ -293,7 +293,7 @@ void AddLanguageWindowView::Layout() {
CSize sz;
accept_language_combobox_->GetPreferredSize(&sz);
accept_language_combobox_->SetBounds(kDialogPadding, kDialogPadding,
- GetWidth() - 2*kDialogPadding, sz.cy);
+ width() - 2*kDialogPadding, sz.cy);
}
void AddLanguageWindowView::GetPreferredSize(CSize* out) {
diff --git a/chrome/browser/views/options/options_group_view.cc b/chrome/browser/views/options/options_group_view.cc
index d905d2b..5dbe96a 100644
--- a/chrome/browser/views/options/options_group_view.cc
+++ b/chrome/browser/views/options/options_group_view.cc
@@ -56,7 +56,7 @@ void OptionsGroupView::SetHighlighted(bool highlighted) {
}
int OptionsGroupView::GetContentsWidth() const {
- return contents_->GetWidth();
+ return contents_->width();
}
///////////////////////////////////////////////////////////////////////////////
@@ -69,8 +69,8 @@ void OptionsGroupView::Paint(ChromeCanvas* canvas) {
GetGValue(infocolor),
GetBValue(infocolor));
int y_offset = kUnrelatedControlVerticalSpacing / 2;
- canvas->FillRectInt(background_color, 0, 0, GetWidth(),
- GetHeight() - y_offset);
+ canvas->FillRectInt(background_color, 0, 0, width(),
+ height() - y_offset);
}
}
diff --git a/chrome/browser/views/options/options_window_view.cc b/chrome/browser/views/options/options_window_view.cc
index 97dfc7e..cb8bb50 100644
--- a/chrome/browser/views/options/options_window_view.cc
+++ b/chrome/browser/views/options/options_window_view.cc
@@ -159,8 +159,8 @@ void OptionsWindowView::TabSelectedAt(int index) {
void OptionsWindowView::Layout() {
tabs_->SetBounds(kDialogPadding, kDialogPadding,
- GetWidth() - (2 * kDialogPadding),
- GetHeight() - (2 * kDialogPadding));
+ width() - (2 * kDialogPadding),
+ height() - (2 * kDialogPadding));
}
void OptionsWindowView::GetPreferredSize(CSize* out) {
diff --git a/chrome/browser/views/page_info_window.cc b/chrome/browser/views/page_info_window.cc
index 2d80ded..8116110 100644
--- a/chrome/browser/views/page_info_window.cc
+++ b/chrome/browser/views/page_info_window.cc
@@ -198,15 +198,15 @@ void SecurityTabView::Section::Layout() {
title_label_->SetBounds(x, y, size.cx, size.cy);
x += size.cx + kHGapTitleToSeparator;
separator_->SetBounds(x + kHExtraSeparatorPadding, y,
- GetWidth() - x - 2 * kHExtraSeparatorPadding, size.cy);
+ width() - x - 2 * kHExtraSeparatorPadding, size.cy);
// Then the image, head-line and description.
x = kHGapToBorder;
- y += title_label_->GetHeight() + kVGapTitleToImage;
+ y += title_label_->height() + kVGapTitleToImage;
status_image_->GetPreferredSize(&size);
status_image_->SetBounds(x, y, size.cx, size.cy);
x += size.cx + kHGapImageToDescription;
- int w = GetWidth() - x;
+ int w = width() - x;
if (!head_line_label_->GetText().empty()) {
head_line_label_->GetPreferredSize(&size);
head_line_label_->SetBounds(x, y, w > 0 ? w : 0, size.cy);
@@ -368,14 +368,14 @@ void SecurityTabView::AddSection(const std::wstring& title,
}
void SecurityTabView::Layout() {
- int width = GetWidth() - 2 * kHGapToBorder;
+ int tab_width = width() - 2 * kHGapToBorder;
int x = kHGapToBorder;
int y = kVGapToBorder;
for (std::vector<Section*>::const_iterator iter = sections_.begin();
iter != sections_.end(); ++iter) {
Section* section = *iter;
- int h = section->GetHeightForWidth(width);
- section->SetBounds(x, y, width, h);
+ int h = section->GetHeightForWidth(tab_width);
+ section->SetBounds(x, y, tab_width, h);
section->Layout();
y += h + kVGapBetweenSections;
}
diff --git a/chrome/browser/views/sad_tab_view.cc b/chrome/browser/views/sad_tab_view.cc
index 938be10..dbcfbfe 100644
--- a/chrome/browser/views/sad_tab_view.cc
+++ b/chrome/browser/views/sad_tab_view.cc
@@ -44,13 +44,13 @@ static SkShader* CreateGradientShader(int end_point) {
}
void SadTabView::Paint(ChromeCanvas* canvas) {
- SkShader* background_shader = CreateGradientShader(GetHeight());
+ SkShader* background_shader = CreateGradientShader(height());
SkPaint paint;
paint.setShader(background_shader);
background_shader->unref();
paint.setStyle(SkPaint::kFill_Style);
canvas->drawRectCoords(0, 0,
- SkIntToScalar(GetWidth()), SkIntToScalar(GetHeight()),
+ SkIntToScalar(width()), SkIntToScalar(height()),
paint);
canvas->DrawBitmapInt(*sad_tab_bitmap_, icon_bounds_.x(), icon_bounds_.y());
@@ -69,21 +69,21 @@ void SadTabView::Paint(ChromeCanvas* canvas) {
void SadTabView::Layout() {
int icon_width = sad_tab_bitmap_->width();
int icon_height = sad_tab_bitmap_->height();
- int icon_x = (GetWidth() - icon_width) / 2;
- int icon_y = ((GetHeight() - icon_height) / 2) + kSadTabOffset;
+ int icon_x = (width() - icon_width) / 2;
+ int icon_y = ((height() - icon_height) / 2) + kSadTabOffset;
icon_bounds_.SetRect(icon_x, icon_y, icon_width, icon_height);
- int title_x = (GetWidth() - title_width_) / 2;
+ int title_x = (width() - title_width_) / 2;
int title_y = icon_bounds_.bottom() + kIconTitleSpacing;
int title_height = title_font_.height();
title_bounds_.SetRect(title_x, title_y, title_width_, title_height);
ChromeCanvas cc(0, 0, true);
- int message_width = static_cast<int>(GetWidth() * kMessageSize);
+ int message_width = static_cast<int>(width() * kMessageSize);
int message_height = 0;
cc.SizeStringInt(message_, message_font_, &message_width, &message_height,
ChromeCanvas::MULTI_LINE);
- int message_x = (GetWidth() - message_width) / 2;
+ int message_x = (width() - message_width) / 2;
int message_y = title_bounds_.bottom() + kTitleMessageSpacing;
message_bounds_.SetRect(message_x, message_y, message_width, message_height);
}
diff --git a/chrome/browser/views/star_toggle.cc b/chrome/browser/views/star_toggle.cc
index 1fc6736..8e34d61 100644
--- a/chrome/browser/views/star_toggle.cc
+++ b/chrome/browser/views/star_toggle.cc
@@ -36,8 +36,8 @@ bool StarToggle::GetState() const {
void StarToggle::Paint(ChromeCanvas* canvas) {
PaintFocusBorder(canvas);
canvas->DrawBitmapInt(state_ ? *state_on_ : *state_off_,
- (GetWidth() - state_off_->width()) / 2,
- (GetHeight() - state_off_->height()) / 2);
+ (width() - state_off_->width()) / 2,
+ (height() - state_off_->height()) / 2);
}
void StarToggle::GetPreferredSize(CSize* out) {
@@ -50,7 +50,7 @@ bool StarToggle::OnMouseDragged(const ChromeViews::MouseEvent& e) {
}
bool StarToggle::OnMousePressed(const ChromeViews::MouseEvent& e) {
- if (e.IsLeftMouseButton() && HitTest(WTL::CPoint(e.GetX(), e.GetY()))) {
+ if (e.IsLeftMouseButton() && HitTest(WTL::CPoint(e.x(), e.y()))) {
RequestFocus();
return true;
}
@@ -59,7 +59,7 @@ bool StarToggle::OnMousePressed(const ChromeViews::MouseEvent& e) {
void StarToggle::OnMouseReleased(const ChromeViews::MouseEvent& e,
bool canceled) {
- if (e.IsLeftMouseButton() && HitTest(WTL::CPoint(e.GetX(), e.GetY())))
+ if (e.IsLeftMouseButton() && HitTest(WTL::CPoint(e.x(), e.y())))
SwitchState();
}
diff --git a/chrome/browser/views/tab_icon_view.cc b/chrome/browser/views/tab_icon_view.cc
index b6358dd..fb2caae 100644
--- a/chrome/browser/views/tab_icon_view.cc
+++ b/chrome/browser/views/tab_icon_view.cc
@@ -97,10 +97,10 @@ void TabIconView::PaintFavIcon(ChromeCanvas* canvas, const SkBitmap& bitmap) {
int bw = bitmap.width();
int bh = bitmap.height();
if (bw <= kFavIconSize && bh <= kFavIconSize) {
- canvas->DrawBitmapInt(bitmap, (GetWidth() - kFavIconSize) / 2,
- (GetHeight() - kFavIconSize) / 2);
+ canvas->DrawBitmapInt(bitmap, (width() - kFavIconSize) / 2,
+ (height() - kFavIconSize) / 2);
} else {
- canvas->DrawBitmapInt(bitmap, 0, 0, bw, bh, 0, 0, GetWidth(), GetHeight(),
+ canvas->DrawBitmapInt(bitmap, 0, 0, bw, bh, 0, 0, width(), height(),
true);
}
}
diff --git a/chrome/browser/views/tabs/tab.cc b/chrome/browser/views/tabs/tab.cc
index ec2ec29..82bb795 100644
--- a/chrome/browser/views/tabs/tab.cc
+++ b/chrome/browser/views/tabs/tab.cc
@@ -218,8 +218,8 @@ void Tab::ButtonPressed(ChromeViews::BaseButton* sender) {
void Tab::MakePathForTab(gfx::Path* path) const {
DCHECK(path);
- SkScalar h = SkIntToScalar(GetHeight());
- SkScalar w = SkIntToScalar(GetWidth());
+ SkScalar h = SkIntToScalar(height());
+ SkScalar w = SkIntToScalar(width());
path->moveTo(0, h);
diff --git a/chrome/browser/views/tabs/tab_renderer.cc b/chrome/browser/views/tabs/tab_renderer.cc
index d7509ab..2dd430d 100644
--- a/chrome/browser/views/tabs/tab_renderer.cc
+++ b/chrome/browser/views/tabs/tab_renderer.cc
@@ -368,7 +368,7 @@ std::wstring TabRenderer::GetTitle() const {
void TabRenderer::Paint(ChromeCanvas* canvas) {
// Don't paint if we're narrower than we can render correctly. (This should
// only happen during animations).
- if (GetWidth() < GetMinimumSize().width())
+ if (width() < GetMinimumSize().width())
return;
// See if the model changes whether the icons should be painted.
@@ -389,7 +389,7 @@ void TabRenderer::Paint(ChromeCanvas* canvas) {
PaintLoadingAnimation(canvas);
} else {
canvas->save();
- canvas->ClipRectInt(0, 0, GetWidth(), GetHeight() - 4);
+ canvas->ClipRectInt(0, 0, width(), height() - 4);
if (should_display_crashed_favicon_) {
canvas->DrawBitmapInt(*crashed_fav_icon, 0, 0,
crashed_fav_icon->width(),
@@ -498,7 +498,7 @@ void TabRenderer::Layout() {
int title_width;
if (close_button_->IsVisible()) {
- title_width = std::max(close_button_->GetX() -
+ title_width = std::max(close_button_->x() -
kTitleCloseButtonSpacing - title_left, 0);
} else {
title_width = std::max(lb.Width() - title_left, 0);
@@ -580,17 +580,17 @@ void TabRenderer::PaintInactiveTabBackground(ChromeCanvas* canvas) {
canvas->DrawBitmapInt(is_otr ? *tab_inactive_otr_l : *tab_inactive_l, 0, 0);
canvas->TileImageInt(is_otr ? *tab_inactive_otr_c : *tab_inactive_c,
tab_inactive_l_width, 0,
- GetWidth() - tab_inactive_l_width - tab_inactive_r_width,
- GetHeight());
+ width() - tab_inactive_l_width - tab_inactive_r_width,
+ height());
canvas->DrawBitmapInt(is_otr ? *tab_inactive_otr_r : *tab_inactive_r,
- GetWidth() - tab_inactive_r_width, 0);
+ width() - tab_inactive_r_width, 0);
}
void TabRenderer::PaintActiveTabBackground(ChromeCanvas* canvas) {
canvas->DrawBitmapInt(*tab_active_l, 0, 0);
canvas->TileImageInt(*tab_active_c, tab_active_l_width, 0,
- GetWidth() - tab_active_l_width - tab_active_r_width, GetHeight());
- canvas->DrawBitmapInt(*tab_active_r, GetWidth() - tab_active_r_width, 0);
+ width() - tab_active_l_width - tab_active_r_width, height());
+ canvas->DrawBitmapInt(*tab_active_r, width() - tab_active_r_width, 0);
}
void TabRenderer::PaintHoverTabBackground(ChromeCanvas* canvas,
@@ -608,8 +608,8 @@ void TabRenderer::PaintHoverTabBackground(ChromeCanvas* canvas,
canvas->DrawBitmapInt(left, 0, 0);
canvas->TileImageInt(center, tab_active_l_width, 0,
- GetWidth() - tab_active_l_width - tab_active_r_width, GetHeight());
- canvas->DrawBitmapInt(right, GetWidth() - tab_active_r_width, 0);
+ width() - tab_active_l_width - tab_active_r_width, height());
+ canvas->DrawBitmapInt(right, width() - tab_active_r_width, 0);
}
void TabRenderer::PaintLoadingAnimation(ChromeCanvas* canvas) {
@@ -617,14 +617,14 @@ void TabRenderer::PaintLoadingAnimation(ChromeCanvas* canvas) {
waiting_animation_frames : loading_animation_frames;
int image_size = frames->height();
int image_offset = animation_frame_ * image_size;
- int dst_y = (GetHeight() - image_size) / 2;
+ int dst_y = (height() - image_size) / 2;
// Just like with the Tab's title and favicon, the position for the page
// loading animation also needs to be mirrored if the View's UI layout is
// right-to-left.
int dst_x;
if (UILayoutIsRightToLeft()) {
- dst_x = GetWidth() - kLeftPadding - image_size;
+ dst_x = width() - kLeftPadding - image_size;
} else {
dst_x = kLeftPadding;
}
@@ -634,10 +634,10 @@ void TabRenderer::PaintLoadingAnimation(ChromeCanvas* canvas) {
}
int TabRenderer::IconCapacity() const {
- if (GetHeight() < GetMinimumSize().height()) {
+ if (height() < GetMinimumSize().height()) {
return 0;
}
- return (GetWidth() - kLeftPadding - kRightPadding) / kFaviconSize;
+ return (width() - kLeftPadding - kRightPadding) / kFaviconSize;
}
bool TabRenderer::ShouldShowIcon() const {
diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc
index 6182e9b..768604c 100644
--- a/chrome/browser/views/tabs/tab_strip.cc
+++ b/chrome/browser/views/tabs/tab_strip.cc
@@ -73,8 +73,8 @@ class NewTabButton : public ChromeViews::Button {
virtual void GetHitTestMask(gfx::Path* path) const {
DCHECK(path);
- SkScalar h = SkIntToScalar(GetHeight());
- SkScalar w = SkIntToScalar(GetWidth());
+ SkScalar h = SkIntToScalar(height());
+ SkScalar w = SkIntToScalar(width());
// These values are defined by the shape of the new tab bitmap. Should that
// bitmap ever change, these values will need to be updated. They're so
@@ -396,15 +396,15 @@ class MoveTabAnimation : public TabStrip::TabAnimation {
double distance = start_tab_b_bounds_.x() - start_tab_a_bounds_.x();
double delta = distance * animation_.GetCurrentValue();
double new_x = start_tab_a_bounds_.x() + delta;
- tab_a_->SetBounds(Round(new_x), tab_a_->GetY(), tab_a_->GetWidth(),
- tab_a_->GetHeight());
+ tab_a_->SetBounds(Round(new_x), tab_a_->y(), tab_a_->width(),
+ tab_a_->height());
// Position Tab B
distance = start_tab_a_bounds_.x() - start_tab_b_bounds_.x();
delta = distance * animation_.GetCurrentValue();
new_x = start_tab_b_bounds_.x() + delta;
- tab_b_->SetBounds(Round(new_x), tab_b_->GetY(), tab_b_->GetWidth(),
- tab_b_->GetHeight());
+ tab_b_->SetBounds(Round(new_x), tab_b_->y(), tab_b_->width(),
+ tab_b_->height());
tabstrip_->SchedulePaint();
}
@@ -470,9 +470,9 @@ class ResizeLayoutAnimation : public TabStrip::TabAnimation {
for (int i = 0; i < tabstrip_->GetTabCount(); ++i) {
Tab* current_tab = tabstrip_->GetTabAt(i);
if (current_tab->IsSelected()) {
- start_selected_width_ = current_tab->GetWidth();
+ start_selected_width_ = current_tab->width();
} else {
- start_unselected_width_ = current_tab->GetWidth();
+ start_unselected_width_ = current_tab->width();
}
}
}
@@ -624,8 +624,8 @@ void TabStrip::PaintChildren(ChromeCanvas* canvas) {
paint.setPorterDuffXfermode(SkPorterDuff::kDstIn_Mode);
paint.setStyle(SkPaint::kFill_Style);
canvas->FillRectInt(
- 0, 0, GetWidth(),
- GetHeight() - 2, // Visible region that overlaps the toolbar.
+ 0, 0, width(),
+ height() - 2, // Visible region that overlaps the toolbar.
paint);
}
@@ -1022,7 +1022,7 @@ void TabStrip::MaybeStartDrag(Tab* tab, const ChromeViews::MouseEvent& event) {
if (IsAnimating() || tab->closing())
return;
drag_controller_.reset(new DraggedTabController(tab, this));
- drag_controller_->CaptureDragInfo(gfx::Point(event.GetX(), event.GetY()));
+ drag_controller_->CaptureDragInfo(gfx::Point(event.x(), event.y()));
}
void TabStrip::ContinueDrag(const ChromeViews::MouseEvent& event) {
@@ -1171,7 +1171,7 @@ void TabStrip::GetDesiredTabWidths(int tab_count,
// Determine how much space we can actually allocate to tabs.
int available_width;
if (available_width_for_tabs_ < 0) {
- available_width = GetWidth();
+ available_width = width();
available_width -= (kNewTabButtonHOffset + newtab_button_size_.width());
} else {
// Interesting corner case: if |available_width_for_tabs_| > the result
@@ -1236,7 +1236,7 @@ void TabStrip::ResizeLayoutTabs() {
// We only want to run the animation if we're not already at the desired
// size.
- if (abs(first_tab->GetWidth() - w) > 1)
+ if (abs(first_tab->width() - w) > 1)
StartResizeLayoutAnimation();
}
@@ -1299,12 +1299,12 @@ gfx::Rect TabStrip::GetDropBounds(int drop_index,
if (drop_index < GetTabCount()) {
Tab* tab = GetTabAt(drop_index);
if (drop_before)
- center_x = tab->GetX() - (kTabHOffset / 2);
+ center_x = tab->x() - (kTabHOffset / 2);
else
- center_x = tab->GetX() + (tab->GetWidth() / 2);
+ center_x = tab->x() + (tab->width() / 2);
} else {
Tab* last_tab = GetTabAt(drop_index - 1);
- center_x = last_tab->GetX() + last_tab->GetWidth() + (kTabHOffset / 2);
+ center_x = last_tab->x() + last_tab->width() + (kTabHOffset / 2);
}
// Mirror the center point if necessary.
@@ -1321,7 +1321,7 @@ gfx::Rect TabStrip::GetDropBounds(int drop_index,
*is_beneath = (monitor_bounds.IsEmpty() ||
!monitor_bounds.Contains(drop_bounds));
if (*is_beneath)
- drop_bounds.Offset(0, drop_bounds.height() + GetHeight());
+ drop_bounds.Offset(0, drop_bounds.height() + height());
return drop_bounds;
}
@@ -1330,13 +1330,13 @@ void TabStrip::UpdateDropIndex(const DropTargetEvent& event) {
// If the UI layout is right-to-left, we need to mirror the mouse
// coordinates since we calculate the drop index based on the
// original (and therefore non-mirrored) positions of the tabs.
- const int x = MirroredXCoordinateInsideView(event.GetX());
+ const int x = MirroredXCoordinateInsideView(event.x());
for (int i = 0; i < GetTabCount(); ++i) {
Tab* tab = GetTabAt(i);
- const int tab_max_x = tab->GetX() + tab->GetWidth();
- const int hot_width = tab->GetWidth() / 3;
+ const int tab_max_x = tab->x() + tab->width();
+ const int hot_width = tab->width() / 3;
if (x < tab_max_x) {
- if (x < tab->GetX() + hot_width)
+ if (x < tab->x() + hot_width)
SetDropIndex(i, true);
else if (x >= tab_max_x - hot_width)
SetDropIndex(i + 1, true);
@@ -1465,7 +1465,7 @@ void TabStrip::LayoutNewTabButton(double last_tab_right,
// We're shrinking tabs, so we need to anchor the New Tab button to the
// right edge of the TabStrip's bounds, rather than the right edge of the
// right-most Tab, otherwise it'll bounce when animating.
- newtab_button_->SetBounds(GetWidth() - newtab_button_size_.width(),
+ newtab_button_->SetBounds(width() - newtab_button_size_.width(),
kNewTabButtonVOffset,
newtab_button_size_.width(),
newtab_button_size_.height());
@@ -1564,7 +1564,7 @@ int TabStrip::GetIndexOfTab(const Tab* tab) const {
}
int TabStrip::GetAvailableWidthForTabs(Tab* last_tab) const {
- return last_tab->GetX() + last_tab->GetWidth();
+ return last_tab->x() + last_tab->width();
}
bool TabStrip::IsPointInTab(Tab* tab, const CPoint& point_in_tabstrip_coords) {
diff --git a/chrome/browser/views/toolbar_star_toggle.cc b/chrome/browser/views/toolbar_star_toggle.cc
index 101d319..d6b1740 100644
--- a/chrome/browser/views/toolbar_star_toggle.cc
+++ b/chrome/browser/views/toolbar_star_toggle.cc
@@ -42,8 +42,8 @@ void ToolbarStarToggle::ShowStarBubble(const GURL& url, bool newly_bookmarked) {
// Shift the x location by 1 as visually the center of the star appears 1
// pixel to the right. By doing this bubble arrow points to the center
// of the star.
- gfx::Rect star_bounds(star_location.x + 1, star_location.y, GetWidth(),
- GetHeight());
+ gfx::Rect star_bounds(star_location.x + 1, star_location.y, width(),
+ height());
BookmarkBubbleView::Show(host_->browser()->GetTopLevelHWND(), star_bounds,
this, host_->profile(), url, newly_bookmarked);
is_bubble_showing_ = true;
diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc
index e2c772f..abbad21 100644
--- a/chrome/browser/views/toolbar_view.cc
+++ b/chrome/browser/views/toolbar_view.cc
@@ -277,11 +277,11 @@ void BrowserToolbarView::Layout() {
back_->SetBounds(kControlIndent, kControlVertOffset, sz.cx, sz.cy);
forward_->GetPreferredSize(&sz);
- forward_->SetBounds(back_->GetX() + back_->GetWidth(), kControlVertOffset,
+ forward_->SetBounds(back_->x() + back_->width(), kControlVertOffset,
sz.cx, sz.cy);
reload_->GetPreferredSize(&sz);
- reload_->SetBounds(forward_->GetX() + forward_->GetWidth() +
+ reload_->SetBounds(forward_->x() + forward_->width() +
kControlHorizOffset,
kControlVertOffset, sz.cx, sz.cy);
@@ -294,11 +294,11 @@ void BrowserToolbarView::Layout() {
sz = CSize(0, 0);
home_->SetVisible(false);
}
- home_->SetBounds(reload_->GetX() + reload_->GetWidth() + offset,
+ home_->SetBounds(reload_->x() + reload_->width() + offset,
kControlVertOffset, sz.cx, sz.cy);
star_->GetPreferredSize(&sz);
- star_->SetBounds(home_->GetX() + home_->GetWidth() + kControlHorizOffset,
+ star_->SetBounds(home_->x() + home_->width() + kControlHorizOffset,
kControlVertOffset, sz.cx, sz.cy);
page_menu_->GetPreferredSize(&sz);
@@ -311,7 +311,7 @@ void BrowserToolbarView::Layout() {
location_bar_height = sz.cy;
right_side_width += sz.cx;
- left_side_width = star_->GetX() + star_->GetWidth();
+ left_side_width = star_->x() + star_->width();
} else {
CSize temp;
location_bar_->GetPreferredSize(&temp);
@@ -322,20 +322,20 @@ void BrowserToolbarView::Layout() {
}
location_bar_->SetBounds(left_side_width, location_bar_y,
- GetWidth() - left_side_width - right_side_width,
+ width() - left_side_width - right_side_width,
location_bar_height);
if (IsDisplayModeNormal()) {
- go_->SetBounds(location_bar_->GetX() + location_bar_->GetWidth(),
+ go_->SetBounds(location_bar_->x() + location_bar_->width(),
kControlVertOffset, sz.cx, sz.cy);
// Make sure the Page menu never overlaps the location bar.
- int page_x = go_->GetX() + go_->GetWidth() + kMenuButtonOffset;
+ int page_x = go_->x() + go_->width() + kMenuButtonOffset;
page_menu_->GetPreferredSize(&sz);
- page_menu_->SetBounds(page_x, kControlVertOffset, sz.cx, go_->GetHeight());
+ page_menu_->SetBounds(page_x, kControlVertOffset, sz.cx, go_->height());
app_menu_->GetPreferredSize(&sz);
- app_menu_->SetBounds(page_menu_->GetX() + page_menu_->GetWidth(),
- page_menu_->GetY(), sz.cx, go_->GetHeight());
+ app_menu_->SetBounds(page_menu_->x() + page_menu_->width(),
+ page_menu_->y(), sz.cx, go_->height());
}
}