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

Side by Side Diff: mojo/examples/window_manager/debug_panel.cc

Issue 663673002: Convert the few remaining ARRAYSIZE_UNSAFE -> arraysize. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/examples/window_manager/debug_panel.h" 5 #include "mojo/examples/window_manager/debug_panel.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "mojo/services/public/cpp/view_manager/view.h" 9 #include "mojo/services/public/cpp/view_manager/view.h"
10 #include "mojo/views/native_widget_view_manager.h" 10 #include "mojo/views/native_widget_view_manager.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 navigation_target_label_->SetBounds( 92 navigation_target_label_->SetBounds(
93 kControlBorderInset, y, w, 93 kControlBorderInset, y, w,
94 navigation_target_label_->GetPreferredSize().height()); 94 navigation_target_label_->GetPreferredSize().height());
95 y += navigation_target_label_->height(); 95 y += navigation_target_label_->height();
96 96
97 views::RadioButton* radios[] = { 97 views::RadioButton* radios[] = {
98 navigation_target_default_, 98 navigation_target_default_,
99 navigation_target_new_, 99 navigation_target_new_,
100 navigation_target_source_, 100 navigation_target_source_,
101 }; 101 };
102 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(radios); ++i) { 102 for (size_t i = 0; i < arraysize(radios); ++i) {
103 radios[i]->SetBounds(kControlBorderInset, y, w, 103 radios[i]->SetBounds(kControlBorderInset, y, w,
104 radios[i]->GetPreferredSize().height()); 104 radios[i]->GetPreferredSize().height());
105 y += radios[i]->height(); 105 y += radios[i]->height();
106 } 106 }
107 107
108 y += kControlBorderInset; 108 y += kControlBorderInset;
109 views::Button* buttons[] = { 109 views::Button* buttons[] = {
110 colored_square_, 110 colored_square_,
111 close_last_, 111 close_last_,
112 cross_app_, 112 cross_app_,
113 }; 113 };
114 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(buttons); ++i) { 114 for (size_t i = 0; i < arraysize(buttons); ++i) {
115 buttons[i]->SetBounds(kControlBorderInset, y, w, 115 buttons[i]->SetBounds(kControlBorderInset, y, w,
116 buttons[i]->GetPreferredSize().height()); 116 buttons[i]->GetPreferredSize().height());
117 y += buttons[i]->height(); 117 y += buttons[i]->height();
118 } 118 }
119 } 119 }
120 120
121 void DebugPanel::ButtonPressed(views::Button* sender, const ui::Event& event) { 121 void DebugPanel::ButtonPressed(views::Button* sender, const ui::Event& event) {
122 if (sender == colored_square_) { 122 if (sender == colored_square_) {
123 Navigate("mojo://mojo_embedded_app/"); 123 Navigate("mojo://mojo_embedded_app/");
124 } else if (sender == close_last_) { 124 } else if (sender == close_last_) {
125 delegate_->CloseTopWindow(); 125 delegate_->CloseTopWindow();
126 } else if (sender == cross_app_) { 126 } else if (sender == cross_app_) {
127 Navigate("http://www.aaronboodman.com/z_dropbox/test.html"); 127 Navigate("http://www.aaronboodman.com/z_dropbox/test.html");
128 } 128 }
129 } 129 }
130 130
131 void DebugPanel::Navigate(const std::string& url) { 131 void DebugPanel::Navigate(const std::string& url) {
132 URLRequestPtr request(URLRequest::New()); 132 URLRequestPtr request(URLRequest::New());
133 request->url = url; 133 request->url = url;
134 delegate_->RequestNavigate(view_->id(), TARGET_NEW_NODE, request.Pass()); 134 delegate_->RequestNavigate(view_->id(), TARGET_NEW_NODE, request.Pass());
135 } 135 }
136 136
137 } // namespace examples 137 } // namespace examples
138 } // namespace mojo 138 } // namespace mojo
OLDNEW
« no previous file with comments | « google_apis/drive/drive_api_url_generator_unittest.cc ('k') | third_party/cld/base/basictypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698